![]() |
![]()
| ![]() |
![]()
NAMEpthread_barrier_destroy ,
pthread_barrier_init ,
pthread_barrier_wait —
destroy, initialize or wait on a barrier object
LIBRARYPOSIX Threads Library (libpthread, -lpthread)SYNOPSIS#include <pthread.h>
int
int
int
DESCRIPTIONThepthread_barrier_init () function will initialize
barrier with attributes specified in
attr, or if it is NULL , with
default attributes. The number of threads that must call
pthread_barrier_wait () before any of the waiting
threads can be released is specified by count. The
pthread_barrier_destroy () function will destroy
barrier and release any resources that may have been
allocated on its behalf.
The IMPLEMENTATION NOTESIn 1:1 Threading Library (libthr, -lthr) thePTHREAD_BARRIER_SERIAL_THREAD return value will always
be returned by the last thread to reach the barrier.
RETURN VALUESIf successful, bothpthread_barrier_destroy () and
pthread_barrier_init () will return zero. Otherwise, an
error number will be returned to indicate the error. If the call to
pthread_barrier_wait () is successful, all but one of
the threads will return zero. That one thread will return
PTHREAD_BARRIER_SERIAL_THREAD . Otherwise, an error
number will be returned to indicate the error.
None of these functions will return
ERRORSThepthread_barrier_destroy () function will fail if:
The
The SEE ALSOpthread_barrierattr(3)HISTORYThepthread_barrier_destroy (),
pthread_barrier_init () and
pthread_barrier_wait () functions first appeared in
N:M Threading Library (libkse, -lkse) in
FreeBSD 5.2, and in 1:1 Threading
Library (libthr, -lthr) in FreeBSD 5.3.
|