 |
Flowgrind
Advanced TCP traffic generator
|
Go to the documentation of this file.
45 if (attr && (*attr != PTHREAD_PROCESS_PRIVATE)) {
50 if (pthread_mutex_init(&barrier->
mutex, NULL) != 0)
53 if (pthread_cond_init(&barrier->
cond, NULL) != 0) {
54 pthread_mutex_destroy(&barrier->
mutex);
71 if (pthread_cond_destroy(&barrier->
cond) != 0)
74 if (pthread_mutex_destroy(&barrier->
mutex) != 0)
87 if (pthread_mutex_lock(&barrier->
mutex) !=0)
94 pthread_cond_broadcast(&barrier->
cond);
96 pthread_cond_wait(&barrier->
cond, &(barrier->
mutex));
99 pthread_mutex_unlock(&barrier->
mutex);
int pthread_barrier_wait(pthread_barrier_t *barrier)
Synchronizes participating threads at the barrier referenced by barrier.
int tripCount
Current number of threads waiting at the barrier.
int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned count)
Allocates resources required to use the barrier referenced by barrier.
int pthread_barrier_destroy(pthread_barrier_t *barrier)
Destroys the barrier referenced by barrier.
pthread_cond_t cond
Thread to suspend its execution until the condition is satisfied.
#define unlikely(x)
These macros gain us a few percent of speed.
Common definitions used by the Flowgrind daemon, controller, and libs.
pthread_mutex_t mutex
Protect shared data structures from concurrent modifications.
Object for barrier synchronization.
Missing pthread barrier implemenation for OS X.
int count
Required number of threads have to wait at the barrier.
int pthread_barrierattr_t
Barrier attribute object.