tests(pthread): status must be 0 if not leader
Fix CI break. man pthread_barrier_wait(3) > ...the constant PTHREAD_BARRIER_SERIAL_THREAD shall be returned to > one *unspecified* thread and zero shall be returned to each of the remaining > threads. Signed-off-by: Anhad Singh <andypython@protonmail.com>
This commit is contained in:
@@ -22,7 +22,9 @@ void *routine(void *arg_raw) {
|
||||
int status = pthread_barrier_wait(arg->barrier);
|
||||
|
||||
arg->is_leader = status == PTHREAD_BARRIER_SERIAL_THREAD;
|
||||
ERROR_IF(pthread_barrier_wait, status, != 0);
|
||||
|
||||
if (!arg->is_leader)
|
||||
ERROR_IF(pthread_barrier_wait, status, != 0);
|
||||
|
||||
// We can now modify the counter.
|
||||
atomic_fetch_add_explicit(arg->count, 1, memory_order_relaxed);
|
||||
|
||||
Reference in New Issue
Block a user