/* ** $Id: semaphore.h,v 1.1 2008/02/01 20:14:43 krishnap Exp $ ** ** Matthew Allen ** description: */ #ifndef _CHIMERA_SEMAPHORE_H_ #define _CHIMERA_SEMAPHORE_H_ #ifdef __cplusplus extern "C" { #endif typedef struct { int val; pthread_mutex_t lock; pthread_cond_t cond; } Sema; void *sema_create (int val); void sema_destroy (void *v); int sema_p (void *v, double timeout); void sema_v (void *v); #ifdef __cplusplus } #endif #endif /* _CHIMERA_SEMAPHORE_H_ */