mirror of
https://github.com/fluencelabs/musl
synced 2025-06-12 22:41:37 +00:00
fix deadlock in condition wait whenever there are multiple waiters
it's amazing none of the conformance tests i've run even bothered to check whether something so basic works...
This commit is contained in:
@ -2,7 +2,8 @@
|
||||
|
||||
int pthread_cond_broadcast(pthread_cond_t *c)
|
||||
{
|
||||
if (a_swap(&c->_c_block, 0))
|
||||
int w = c->_c_waiters;
|
||||
if (a_swap(&c->_c_block, 0) || w)
|
||||
__wake(&c->_c_block, -1, 0);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user