summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-12-24 07:41:39 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-12-24 07:41:39 +0000
commit1d89f14a5c73f15c775296de015f425df23c8d94 (patch)
tree9d73a61019b085dd29e805650bb45f68f2c9bd84 /lib/libthr/thread
parentc5439e96610a78e072b84e8f862c65ce43ca6d16 (diff)
downloadFreeBSD-src-1d89f14a5c73f15c775296de015f425df23c8d94.zip
FreeBSD-src-1d89f14a5c73f15c775296de015f425df23c8d94.tar.gz
Always clear flag PMUTEX_FLAG_DEFERED when unlocking, as it is only
significant for lock owner.
Diffstat (limited to 'lib/libthr/thread')
-rw-r--r--lib/libthr/thread/thr_mutex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index bd1fc2b..d583a20 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -653,7 +653,7 @@ mutex_unlock_common(struct pthread_mutex *m, int cv)
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 *m, int cv)
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;
OpenPOWER on IntegriCloud