barrier_wait(3synch) barrier_wait(3synch)
NAME
barrier_wait - wait at a blocking barrier
SYNOPSIS
cc [options] -Kthread file
#include <synch.h>
int barrier_wait(barrier_t *barrier);
Parameters
barrier
pointer to barrier at which to wait
DESCRIPTION
barrier_wait blocks the calling thread at a barrier until
count threads have called it. count is defined during
initialization with barrier_init. A thread is said to have
reached the barrier when it calls barrier_wait.
When the last thread reaches the barrier, all count -1 blocked
threads are released from the barrier and are allowed to
resume execution. The barrier is reset after the waiting
threads are released.
barrier must previously have been initialized (see
barrier_init).
From the point of view of the caller, barrier_wait is atomic:
even if interrupted by a signal or forkall [see fork(2)],
barrier_wait will not return until count threads have reached
the barrier.
The order in which threads are released from the barrier is
scheduling policy specific for bound threads, and may depend
on scheduling parameters for multiplexed threads.
Return Values
barrier_wait returns zero for success and an error number for
failure, as described below.
Errors
If one of the following conditions is detected, barrier_wait
returns the corresponding value:
EINVAL Invalid argument specified.
Copyright 1994 Novell, Inc. Page 1
barrier_wait(3synch) barrier_wait(3synch)
REFERENCES
barrier(3synch), barrier_destroy(3synch),
barrier_init(3synch), fork(2), synch(3synch)
Copyright 1994 Novell, Inc. Page 2