/* ------------------------------ $Id: abar.h,v 1.1 2006/01/27 08:40:46 marquet Exp $ ------------------------------------------------------------ Asymmetric barrier synchronization Philippe Marquet, Jan 2006 */ #ifndef _ABAR_H_ #define _ABAR_H_ typedef struct abar_s abar_t; /* Called by the master to allocate and initialize a barrier for use by n_slaves slave processes */ abar_t *abar_init(int n_slaves); /* Called by master to indicate it is finished with the barrier. No slaves must be waiting in the barrier at the time of the call */ int abar_destroy(abar_t *b); /* Called by the master to wait for all slaves to enter the barrier. Returns when all slaves have called barrier_slave. */ int abar_master(abar_t *b); /* Called by a slave to enter the barrier. Returns after the master has released the barrier (barrier_release) */ int abar_slave(abar_t *b); /* Called by the master to release all the slaves that have entered the barrier */ int abar_release(abar_t *b); #endif