00001 /* 00002 ** $Id: semaphore_8h-source.html,v 1.1 2007/08/02 18:36:21 krishnap Exp $ 00003 ** 00004 ** Matthew Allen 00005 ** description: 00006 */ 00007 00008 #ifndef _CHIMERA_SEMAPHORE_H_ 00009 #define _CHIMERA_SEMAPHORE_H_ 00010 00011 typedef struct { 00012 int val; 00013 pthread_mutex_t lock; 00014 pthread_cond_t cond; 00015 } Sema; 00016 00017 void *sema_create(int val); 00018 void sema_destroy(void *v); 00019 int sema_p(void *v, double timeout); 00020 void sema_v(void *v); 00021 00022 #endif /* _CHIMERA_SEMAPHORE_H_ */