mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
After careful consideration (and a brief discussion with attilio@), change
the semantics of pthread_mutex_islocked_np() to return true if and only if the mutex is held by the current thread. Obviously, change the regression test to match. MFC after: 2 weeks
This commit is contained in:
parent
3f0bfcccfd
commit
fcd61d9141
2 changed files with 3 additions and 3 deletions
|
|
@ -877,5 +877,5 @@ _pthread_mutex_islocked_np(pthread_mutex_t *mutex)
|
|||
if (__predict_false(ret))
|
||||
return (ret);
|
||||
}
|
||||
return ((*mutex)->m_qe.tqe_prev != NULL);
|
||||
return ((*mutex)->m_lock.m_owner == TID(curthread));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ thread(void *arg)
|
|||
{
|
||||
pthread_mutex_t *mtx = arg;
|
||||
|
||||
if (pthread_mutex_islocked_np(mtx) == 0) {
|
||||
printf("pthread_mutex_islocked_np() returned zero\n"
|
||||
if (pthread_mutex_islocked_np(mtx) != 0) {
|
||||
printf("pthread_mutex_islocked_np() returned non-zero\n"
|
||||
"for a mutex held by another thread\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue