| PTHREAD_BARRIER_WAIT(3) | Library Functions Manual | PTHREAD_BARRIER_WAIT(3) |
pthread_barrier_wait —
synchronize at a barrier
POSIX Threads Library (libpthread,
-lpthread)
#include <pthread.h>
int
pthread_barrier_wait(pthread_barrier_t
*barrier);
The
pthread_barrier_wait()
function blocks the calling thread until the required number of threads call
pthread_barrier_wait(), as specified at the object's
initialization.
If successful, pthread_barrier_wait()
returns PTHREAD_BARRIER_SERIAL_THREAD for a single
arbitrary thread and zero for each of the other threads; otherwise an error
number is returned to indicate the error.
pthread_barrier_wait() will fail if:
EINVAL]pthread_barrier_init(3), pthread_barrierattr_getpshared(3), pthread_barrierattr_init(3)
pthread_barrier_wait() conforms to
IEEE Std 1003.1-2008 (“POSIX.1”).
| June 7, 2025 | Debian |