mirror of
https://github.com/fluencelabs/musl
synced 2025-06-21 18:51:52 +00:00
fix logic for when wakeup is not desired on cond bcast
somehow i forgot that normal-type mutexes don't store the owner tid.
This commit is contained in:
@ -37,10 +37,11 @@ int pthread_cond_broadcast(pthread_cond_t *c)
|
|||||||
a_fetch_add(&m->_m_waiters, -w);
|
a_fetch_add(&m->_m_waiters, -w);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Perform the futex requeue, waking one waiter if and only if
|
/* Perform the futex requeue, waking one waiter unless we know
|
||||||
* the calling thread does not hold the mutex. */
|
* that the calling thread holds the mutex. */
|
||||||
__syscall(SYS_futex, &c->_c_block, FUTEX_REQUEUE,
|
__syscall(SYS_futex, &c->_c_block, FUTEX_REQUEUE,
|
||||||
m->_m_lock!=pthread_self()->tid, INT_MAX, &m->_m_lock);
|
!m->_m_type || (m->_m_lock&INT_MAX)!=pthread_self()->tid,
|
||||||
|
INT_MAX, &m->_m_lock);
|
||||||
|
|
||||||
unlock(c);
|
unlock(c);
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user