Skip to content
Snippets Groups Projects
Verified Commit a527cc53 authored by Anhad Singh's avatar Anhad Singh :crab:
Browse files

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: default avatarAnhad Singh <andypython@protonmail.com>
parent 55ba8d8f
No related branches found
No related tags found
1 merge request!570fix(ld_so): for Linux
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment