pthread_barrier_init(3) - NetBSD Manual Pages

PTHREAD_BARRIER_INIT(3) NetBSD Library Functions ManualPTHREAD_BARRIER_INIT(3)


NAME
pthread_barrier_init -- create a barrier
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h> int pthread_barrier_init(pthread_barrier_t * restrict barrier, const pthread_barrierattr_t * restrict attr, unsigned int count);
DESCRIPTION
The pthread_barrier_init() function creates a new barrier, with attributes specified with attr and count. The count parameter indicates the number of threads which will participate in the barrier. If attr is NULL the default attributes are used. Barriers are most commonly used in the decomposition of parallel loops.
RETURN VALUES
If successful, pthread_barrier_init() will return zero and put the new barrier id into barrier, otherwise an error number will be returned to indicate the error.
ERRORS
pthread_barrier_init() shall fail if: [EAGAIN] The system lacks the resources to initialize another barrier. [EINVAL] The value specified by count is zero. [ENOMEM] Insufficient memory exists to initialize the barrier. pthread_barrier_init() may fail if: [EBUSY] The barrier structure has been initialized already. [EINVAL] The value specified by attr is invalid.
SEE ALSO
pthread_barrier_destroy(3), pthread_barrier_wait(3), pthread_barrierattr_destroy(3), pthread_barrierattr_init(3)
STANDARDS
pthread_barrier_init() conforms to IEEE Std 1003.1-2001 (``POSIX.1''). NetBSD 5.0.1 January 30, 2003 NetBSD 5.0.1

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.