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...).
This commit is contained in:
Jason Evans 2017-05-14 17:10:55 +00:00
parent c95ad43c19
commit e01ea25be5

View File

@ -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);