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...).

MFC after:	1 day
This commit is contained in:
Jason Evans 2017-05-13 17:49:53 +00:00
parent 2438ef7673
commit c45e7190ab
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=318254

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