summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-08-26 07:09:48 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-08-26 07:09:48 +0000
commit4dfe518936104e22919fdfc5638b10731caca8d4 (patch)
tree6d5aad4c9d29b8bb3e8f79d060b25d925257aa12
parent61dc20268cc1765a4a6da507e317e05bb2576688 (diff)
downloadFreeBSD-src-4dfe518936104e22919fdfc5638b10731caca8d4.zip
FreeBSD-src-4dfe518936104e22919fdfc5638b10731caca8d4.tar.gz
Decrease rdlock count only when thread unlocked a reader lock.
MFC after: 3 days
-rw-r--r--lib/libthr/thread/thr_rtld.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c
index 4db08bd..2560a94 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);
OpenPOWER on IntegriCloud