From 3cab47dbeab4348f73168efe453cd8dffb9bdffe Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Thu, 24 Aug 2000 19:06:38 +0000 Subject: [PATCH] A read lock could incorrectly be granted in some cases. --- lib/isc/rwlock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/isc/rwlock.c b/lib/isc/rwlock.c index 1e83c11156..c47ef89954 100644 --- a/lib/isc/rwlock.c +++ b/lib/isc/rwlock.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rwlock.c,v 1.21 2000/08/24 17:06:31 gson Exp $ */ +/* $Id: rwlock.c,v 1.22 2000/08/24 19:06:38 bwelling Exp $ */ #include @@ -121,9 +121,9 @@ isc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) { while (!done) { if (!skip && ((rwl->active == 0 || - rwl->writers_waiting == 0 || (rwl->type == isc_rwlocktype_read && - rwl->granted < rwl->read_quota)))) + (rwl->writers_waiting == 0 || + rwl->granted < rwl->read_quota))))) { rwl->type = isc_rwlocktype_read; rwl->active++;