diff options
author | davidxu <davidxu@FreeBSD.org> | 2008-04-01 06:23:08 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2008-04-01 06:23:08 +0000 |
commit | 111802a962883418b89f19ea37fb8d91d91909a1 (patch) | |
tree | fa52f289c498b95217679c743b66ca65c19b2ec6 /lib/libthr/thread/thr_rwlock.c | |
parent | 426badf1fa06d3025c3e1d27462b5cb85f06ee6c (diff) | |
download | FreeBSD-src-111802a962883418b89f19ea37fb8d91d91909a1.zip FreeBSD-src-111802a962883418b89f19ea37fb8d91d91909a1.tar.gz |
Restore normal pthread_cond_signal path to avoid some obscure races.
Diffstat (limited to 'lib/libthr/thread/thr_rwlock.c')
-rw-r--r-- | lib/libthr/thread/thr_rwlock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_rwlock.c b/lib/libthr/thread/thr_rwlock.c index 0380072..d52454f 100644 --- a/lib/libthr/thread/thr_rwlock.c +++ b/lib/libthr/thread/thr_rwlock.c @@ -479,7 +479,7 @@ _pthread_rwlock_unlock (pthread_rwlock_t *rwlock) return (EPERM); } -#if 0 +#if 1 if (state & RWLOCK_WRITE_WAITERS) { _pthread_mutex_lock(&prwlock->lock); _pthread_cond_signal(&prwlock->write_signal); @@ -489,7 +489,7 @@ _pthread_rwlock_unlock (pthread_rwlock_t *rwlock) _pthread_cond_broadcast(&prwlock->read_signal); _pthread_mutex_unlock(&prwlock->lock); } -#endif +#else if (state & RWLOCK_WRITE_WAITERS) { _pthread_mutex_lock(&prwlock->lock); @@ -498,5 +498,6 @@ _pthread_rwlock_unlock (pthread_rwlock_t *rwlock) _pthread_mutex_lock(&prwlock->lock); _pthread_cond_broadcast_unlock(&prwlock->write_signal, &prwlock->lock, 1); } +#endif return (0); } |