From 496ff1af4580cae19e94bc6d1c5a26b0ff888747 Mon Sep 17 00:00:00 2001 From: davidxu Date: Fri, 14 Mar 2003 01:02:47 +0000 Subject: Fix a bug in rwlock. When a rwlock was locked by reader threads, a writter thread can block reader threads to get read lock. --- lib/libpthread/thread/thr_rwlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libpthread') diff --git a/lib/libpthread/thread/thr_rwlock.c b/lib/libpthread/thread/thr_rwlock.c index f41e8a2..ce9eb8a 100644 --- a/lib/libpthread/thread/thr_rwlock.c +++ b/lib/libpthread/thread/thr_rwlock.c @@ -157,7 +157,7 @@ _pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) return(ret); /* give writers priority over readers */ - while (prwlock->blocked_writers || prwlock->state < 0) { + while (prwlock->state < 0) { ret = pthread_cond_wait(&prwlock->read_signal, &prwlock->lock); if (ret != 0) { -- cgit v1.1