ergo
barrier.c File Reference
#include <errno.h>
#include <pthread.h>
#include "barrier.h"

Functions

int ergo_barrier_init (ergo_barrier_t *barrier, const void *attr_ignored, unsigned int count)
 
int ergo_barrier_destroy (ergo_barrier_t *barrier)
 
int ergo_barrier_wait (ergo_barrier_t *barrier)
 

Detailed Description

implements a pthread-compatible barrier. This is to be used with older pthread implementations that do not provide barriers. This implementation is applicable only in simple cases. Check section 7.1.1 of "Programming with POSIX threads" for a full-blown implementation. In particular, this implementation does not check for some error conditions, like destroying the barrier when some threads wait on it.

Function Documentation

◆ ergo_barrier_destroy()

int ergo_barrier_destroy ( ergo_barrier_t barrier)

◆ ergo_barrier_init()

int ergo_barrier_init ( ergo_barrier_t barrier,
const void *  attr_ignored,
unsigned int  count 
)

◆ ergo_barrier_wait()