summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_mutex.c
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2017-05-14 17:10:55 +0000
committerjasone <jasone@FreeBSD.org>2017-05-14 17:10:55 +0000
commit8dad4589a874ed1c832c9c4aa0ac59a53fe24e8c (patch)
tree62d35abfe7d18e2348b2c3ef1d17e7620bbbe935 /lib/libthr/thread/thr_mutex.c
parent6314dd4b859877b0b6e62bfee0679ff14f562d1b (diff)
downloadFreeBSD-src-8dad4589a874ed1c832c9c4aa0ac59a53fe24e8c.zip
FreeBSD-src-8dad4589a874ed1c832c9c4aa0ac59a53fe24e8c.tar.gz
MFC r318254:
Fix __pthread_mutex_trylock() to call THR_CRITICAL_LEAVE() on failure rather than on success. This regression was introduced by r300043 (Add implementation of robust mutexes...).
Diffstat (limited to 'lib/libthr/thread/thr_mutex.c')
-rw-r--r--lib/libthr/thread/thr_mutex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index da53c85..877bd37 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -631,7 +631,7 @@ __pthread_mutex_trylock(pthread_mutex_t *mutex)
} /* else {} */
if (robust)
_mutex_leave_robust(curthread, m);
- if ((ret == 0 || ret == EOWNERDEAD) &&
+ if (ret != 0 && ret != EOWNERDEAD &&
(m->m_flags & PMUTEX_FLAG_PRIVATE) != 0)
THR_CRITICAL_LEAVE(curthread);
return (ret);
OpenPOWER on IntegriCloud