Lines Matching defs:barrier
10 * a barrier to be operated upon by any thread that has access to the memory
11 * where the barrier is allocated. If the process-shared attribute
12 * is PTHREAD_PROCESS_PRIVATE, the barrier shall only be operated
14 * that initialized the barrier; if threads of different processes attempt
15 * to operate on such a barrier, the behavior is undefined.
20 * 1. Create a piece of shared memory object, create pthread barrier object 'barrier'
22 * 2. Parent map the shared memory to its memory space, put 'barrier' into it;
24 * 4. Child process map the 'barrier' to its memory space;
61 static pthread_barrier_t *barrier;
80 /* Initialize a barrier attributes object */
119 barrier = mmap(NULL, sizeof(pthread_barrier_t), PROT_READ | PROT_WRITE,
122 if (barrier == MAP_FAILED) {
128 /* Initialize a barrier */
129 if ((pthread_barrier_init(barrier, &ba, 2)) != 0) {
148 barrier =
152 if (barrier == MAP_FAILED) {
164 rc = pthread_barrier_wait(barrier);
201 if (pthread_barrier_destroy(barrier) != 0) {