svn commit: r211833 - head/lib/libthr/thread

David Xu davidxu at FreeBSD.org
Thu Aug 26 07:09:49 UTC 2010


Author: davidxu
Date: Thu Aug 26 07:09:48 2010
New Revision: 211833
URL: http://svn.freebsd.org/changeset/base/211833

Log:
  Decrease rdlock count only when thread unlocked a reader lock.
  
  MFC after:	3 days

Modified:
  head/lib/libthr/thread/thr_rtld.c

Modified: head/lib/libthr/thread/thr_rtld.c
==============================================================================
--- head/lib/libthr/thread/thr_rtld.c	Thu Aug 26 05:25:51 2010	(r211832)
+++ head/lib/libthr/thread/thr_rtld.c	Thu Aug 26 07:09:48 2010	(r211833)
@@ -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);


More information about the svn-src-head mailing list