Decrease rdlock count only when thread unlocked a reader lock.

MFC after:	3 days
This commit is contained in:
davidxu 2010-08-26 07:09:48 +00:00
parent 61dc20268c
commit 4dfe518936

View File

@ -149,8 +149,8 @@ _thr_rtld_lock_release(void *lock)
state = l->lock.rw_state; state = l->lock.rw_state;
if (_thr_rwlock_unlock(&l->lock) == 0) { if (_thr_rwlock_unlock(&l->lock) == 0) {
curthread->rdlock_count--;
if ((state & URWLOCK_WRITE_OWNER) == 0) { if ((state & URWLOCK_WRITE_OWNER) == 0) {
curthread->rdlock_count--;
THR_CRITICAL_LEAVE(curthread); THR_CRITICAL_LEAVE(curthread);
} else { } else {
_thr_signal_unblock(curthread); _thr_signal_unblock(curthread);