Index: lib/libthr/thread/thr_rwlock.c =================================================================== --- lib/libthr/thread/thr_rwlock.c (revision 195300) +++ lib/libthr/thread/thr_rwlock.c (working copy) @@ -177,10 +177,11 @@ /* if interrupted, try to lock it in userland again. */ if (_thr_rwlock_tryrdlock(&prwlock->lock, flags) == 0) { ret = 0; - curthread->rdlock_count++; break; } } + if (ret == 0) + curthread->rdlock_count++; return (ret); } Index: lib/libthr/thread/thr_rtld.c =================================================================== --- lib/libthr/thread/thr_rtld.c (revision 195300) +++ lib/libthr/thread/thr_rtld.c (working copy) @@ -114,6 +114,7 @@ THR_CRITICAL_ENTER(curthread); while (_thr_rwlock_rdlock(&l->lock, 0, NULL) != 0) ; + curthread->rdlock_count++; RESTORE_ERRNO(); } @@ -148,6 +149,7 @@ state = l->lock.rw_state; if (_thr_rwlock_unlock(&l->lock) == 0) { + curthread->rdlock_count--; if ((state & URWLOCK_WRITE_OWNER) == 0) { THR_CRITICAL_LEAVE(curthread); } else {