NAME
pthread_barrier_wait
- wait for a barrier
LIBRARY
POSIX Thread Library (libpthread, -lpthread)
SYNOPSIS
int
pthread_barrier_wait(
pthread_barrier_t *barrier
)
DESCRIPTION
The
pthread_barrier_wait(
)
function causes the current thread to wait on the barrier specified.
Once as many threads as specified by the
count
parameter to the corresponding
pthread_barrier_init(
)
call have called
pthread_barrier_wait(
),
all threads will wake up, return from their respective
pthread_barrier_wait(
)
calls and continue execution.
RETURN VALUES
If successful,
pthread_barrier_wait(
)
will return zero for all waiting threads except for one.
One thread will receive status
PTHREAD_BARRIER_SERIAL_THREAD
,
which is intended to indicate that this thread may be used to update
shared data.
It is the responsibility of this thread to insure the visibility
and atomicity of any updates to shared data with respect to the
other threads participating in the barrier.
In the case of failure, an error value will be returned.
ERRORS
pthread_barrier_wait(
)
may fail if:
- [
EINVAL
] -
The value specified by
barrier
is invalid.
SEE ALSO
pthread_barrier_destroy(3),
pthread_barrier_init(3),
pthread_barrierattr_destroy(3),
pthread_barrierattr_init(3)
STANDARDS
pthread_barrier_wait(
)
conforms to
IEEE Std 1003.1-2001 (``POSIX.1'') .