pg_pthread.h File Reference
#include <pthread.h>
Include dependency graph for pg_pthread.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Macro Definition Documentation
◆ PTHREAD_BARRIER_SERIAL_THREAD
#define PTHREAD_BARRIER_SERIAL_THREAD (-1)
Typedef Documentation
◆ pthread_barrier_t
Function Documentation
◆ pthread_barrier_destroy()
◆ pthread_barrier_init()
const void *
attr,
int
count
)
◆ pthread_barrier_wait()
Definition at line 38 of file pthread_barrier_wait.c.
39{
40 bool initial_sense;
41
43
44 /* We have arrived at the barrier. */
47
48 /* If we were the last to arrive, release the others and return. */
50 {
54 pthread_cond_broadcast(&
barrier->cond);
55
57 }
58
59 /* Wait for someone else to flip the sense. */
61 do
62 {
64 }
while (
barrier->sense == initial_sense);
65
67
68 return 0;
69}
Assert(PointerIsAligned(start, uint64))
#define PTHREAD_BARRIER_SERIAL_THREAD
int pthread_mutex_unlock(pthread_mutex_t *mp)
int pthread_mutex_lock(pthread_mutex_t *mp)
References Assert(), barrier, PTHREAD_BARRIER_SERIAL_THREAD, pthread_mutex_lock(), and pthread_mutex_unlock().