aboutsummaryrefslogtreecommitdiff
path: root/lib/libthr
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2010-12-24 07:41:39 +0000
committerDavid Xu <davidxu@FreeBSD.org>2010-12-24 07:41:39 +0000
commite29ba4c2dbd33049583e4b2ac76feb45d0190f1d (patch)
tree9d73a61019b085dd29e805650bb45f68f2c9bd84 /lib/libthr
parent5f523ccd1c48b0414da5c131b823351a255e7ecf (diff)
downloadsrc-e29ba4c2dbd33049583e4b2ac76feb45d0190f1d.tar.gz
src-e29ba4c2dbd33049583e4b2ac76feb45d0190f1d.zip
Always clear flag PMUTEX_FLAG_DEFERED when unlocking, as it is only
significant for lock owner.
Notes
Notes: svn path=/head/; revision=216687
Diffstat (limited to 'lib/libthr')
-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 bd1fc2b550e3..d583a207d683 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;