barrier.c File Reference

implements a pthread-compatible barrier. More...

#include <errno.h>
#include <pthread.h>
#include "barrier.h"

Functions

int ergo_barrier_init (ergo_barrier_t *__restrict 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

int ergo_barrier_destroy ( ergo_barrier_t barrier  ) 

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

int ergo_barrier_wait ( ergo_barrier_t barrier  ) 


Generated on Wed Nov 21 09:32:02 2012 for ergo by  doxygen 1.4.7