Go to the documentation of this file.
17 #ifndef PTHREAD_BARRIER_H
18 #define PTHREAD_BARRIER_H
32 #define PTHREAD_PROCESS_SHARED (0)
39 #define PTHREAD_PROCESS_PRIVATE (1)
Details for a pthread_barrier_t.
int16_t kernel_pid_t
Unique process identifier.
int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count)
Initializes a pthread_barrier_t.
int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr, int pshared)
Set if the barrier should be shared with child processes.
volatile int count
Wait for N more threads before waking everyone up.
kernel_pid_t pid
The current thread to wake up.
int pthread_barrier_destroy(pthread_barrier_t *barrier)
Destroys a pthread_barrier_t.
int pthread_barrier_wait(pthread_barrier_t *barrier)
Waiting on a synchronization barrier.
int pthread_barrierattr_destroy(pthread_barrierattr_t *attr)
Destroy a pthread_barrierattr_t.
struct pthread_barrier_waiting_node pthread_barrier_waiting_node_t
Internal structure to store the list of waiting threads.
volatile int cont
0 = spurious wake up, 1 = wake up
struct pthread_barrier_waiting_node * next
The next waiting thread.
mutex_t mutex
Mutex to unlock to wake the thread up.
Mutex for thread synchronization.
struct pthread_barrier_waiting_node * next
The first waiting thread.
A synchronization barrier.
int pthread_barrierattr_getpshared(const pthread_barrierattr_t *attr, int *pshared)
Returns whether the barrier attribute was set to be shared.
int pshared
See pthread_barrierattr_setpshared() and pthread_barrierattr_getpshared().
int pthread_barrierattr_init(pthread_barrierattr_t *attr)
Initialize a pthread_barrierattr_t.
Internal structure to store the list of waiting threads.