correctly handle the degenerate barrier in the pshared case
This commit is contained in:
parent
3ac092bd7d
commit
067bdc2c18
1 changed files with 1 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ static int pshared_barrier_wait(pthread_barrier_t *b)
|
||||||
int seq;
|
int seq;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!limit) return PTHREAD_BARRIER_SERIAL_THREAD;
|
if (limit==1) return PTHREAD_BARRIER_SERIAL_THREAD;
|
||||||
|
|
||||||
while (a_swap(&b->_b_lock, 1))
|
while (a_swap(&b->_b_lock, 1))
|
||||||
__wait(&b->_b_lock, &b->_b_waiters, 1, 0);
|
__wait(&b->_b_lock, &b->_b_waiters, 1, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue