svn commit: r318277 - stable/11/lib/libthr/thread
Jason Evans
jasone at FreeBSD.org
Sun May 14 17:10:57 UTC 2017
Author: jasone
Date: Sun May 14 17:10:55 2017
New Revision: 318277
URL: https://svnweb.freebsd.org/changeset/base/318277
Log:
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...).
Modified:
stable/11/lib/libthr/thread/thr_mutex.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/lib/libthr/thread/thr_mutex.c
==============================================================================
--- stable/11/lib/libthr/thread/thr_mutex.c Sun May 14 14:27:59 2017 (r318276)
+++ stable/11/lib/libthr/thread/thr_mutex.c Sun May 14 17:10:55 2017 (r318277)
@@ -631,7 +631,7 @@ __pthread_mutex_trylock(pthread_mutex_t
} /* 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);
More information about the svn-src-stable-11
mailing list