SYNOPSIS
#include <pthread.h>
int pthread_barrier_destroy(pthread_barrier_t *barrier);
int pthread_barrier_init(pthread_barrier_t *restrict barrier, const pthread_barrierattr_t *restrict attr, unsigned count);
DESCRIPTION
The
The
The count argument to
When the
You should only use the object pointed to by barrier to
perform synchronization. Using copies of that object with
PARAMETERS
- attr
-
Points to the attributes to be used when initializing a barrier with
pthread_barrier_init() . - barrier
-
Points to the barrier to be destroyed by
pthread_barrier_destroy() or initialized bypthread_barrier_init() . - count
-
Indicates how many threads (minimum of one) must call the
pthread_barrier_wait() function before any of those threads successfully return from the call.
RETURN VALUES
When successful, the
- EBUSY
-
An attempt to destroy a barrier occurred while another thread was using the barrier (for example, in a
pthread_barrier_wait() call). - EINVAL
-
The barrier argument is an invalid value.
When successful, the
- EAGAIN
-
Another barrier could not be initialized due to a lack of necessary resources.
- EINVAL
-
The count argument is equal to zero.
- ENOMEM
-
There is not enough available memory to initialize the barrier.
- EBUSY
-
An attempt to reinitialize a barrier occurred while another thread was using the barrier (for example, in a
pthread_barrier_wait() call). - EINVAL
-
The attr attribute points to an invalid value.
CONFORMANCE
UNIX 03.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
pthread_barrier_wait()
PTC MKS Toolkit 10.5 Documentation Build 40.