Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Dec 2010 07:41:39 +0000 (UTC)
From:      David Xu <davidxu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216687 - head/lib/libthr/thread
Message-ID:  <201012240741.oBO7fd9X082480@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davidxu
Date: Fri Dec 24 07:41:39 2010
New Revision: 216687
URL: http://svn.freebsd.org/changeset/base/216687

Log:
  Always clear flag PMUTEX_FLAG_DEFERED when unlocking, as it is only
  significant for lock owner.

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

Modified: head/lib/libthr/thread/thr_mutex.c
==============================================================================
--- head/lib/libthr/thread/thr_mutex.c	Fri Dec 24 06:41:29 2010	(r216686)
+++ head/lib/libthr/thread/thr_mutex.c	Fri Dec 24 07:41:39 2010	(r216687)
@@ -653,7 +653,7 @@ mutex_unlock_common(struct pthread_mutex
 		m->m_count > 0)) {
 		m->m_count--;
 	} else {
-		if (curthread->will_sleep == 0 && (m->m_flags & PMUTEX_FLAG_DEFERED) != 0) {
+		if ((m->m_flags & PMUTEX_FLAG_DEFERED) != 0) {
 			defered = 1;
 			m->m_flags &= ~PMUTEX_FLAG_DEFERED;
         	} else
@@ -662,7 +662,7 @@ mutex_unlock_common(struct pthread_mutex
 		DEQUEUE_MUTEX(curthread, m);
 		_thr_umutex_unlock(&m->m_lock, id);
 
-		if (defered)  {
+		if (curthread->will_sleep == 0 && defered)  {
 			_thr_wake_all(curthread->defer_waiters,
 				curthread->nwaiter_defer);
 			curthread->nwaiter_defer = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012240741.oBO7fd9X082480>