diff options
Diffstat (limited to 'src/thread/pthread_rwlock_unlock.c')
-rw-r--r-- | src/thread/pthread_rwlock_unlock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/thread/pthread_rwlock_unlock.c b/src/thread/pthread_rwlock_unlock.c index a6d20854..7b5eec84 100644 --- a/src/thread/pthread_rwlock_unlock.c +++ b/src/thread/pthread_rwlock_unlock.c @@ -2,7 +2,7 @@ int pthread_rwlock_unlock(pthread_rwlock_t *rw) { - int val, cnt, waiters, new; + int val, cnt, waiters, new, priv = rw->_rw_shared^128; do { val = rw->_rw_lock; @@ -12,7 +12,7 @@ int pthread_rwlock_unlock(pthread_rwlock_t *rw) } while (a_cas(&rw->_rw_lock, val, new) != val); if (!new && (waiters || val<0)) - __wake(&rw->_rw_lock, cnt, 0); + __wake(&rw->_rw_lock, cnt, priv); return 0; } |