From 6b932eca796b2b80b5295abc853f56cb3f8a15f9 Mon Sep 17 00:00:00 2001 From: David Xu Date: Thu, 26 Aug 2010 07:09:48 +0000 Subject: [PATCH] Decrease rdlock count only when thread unlocked a reader lock. MFC after: 3 days --- lib/libthr/thread/thr_rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c index 4db08bd617c0..2560a941d3a8 100644 --- a/lib/libthr/thread/thr_rtld.c +++ b/lib/libthr/thread/thr_rtld.c @@ -149,8 +149,8 @@ _thr_rtld_lock_release(void *lock) state = l->lock.rw_state; if (_thr_rwlock_unlock(&l->lock) == 0) { - curthread->rdlock_count--; if ((state & URWLOCK_WRITE_OWNER) == 0) { + curthread->rdlock_count--; THR_CRITICAL_LEAVE(curthread); } else { _thr_signal_unblock(curthread);