00001 00013 #ifndef _CONDVAR_H_ 00014 #define _CONDVAR_H_ 00015 00016 #include "mutex.h" 00017 #include "tqueue.h" 00018 #include "thread.h" 00019 00021 struct cond { 00023 thread_queue_t tq; 00024 }; 00025 00027 typedef struct cond cond_t; 00028 00029 void cond_init (cond_t * cvar); 00030 void cond_destroy (cond_t * cvar); 00031 void cond_signal (cond_t * cvar); 00032 void cond_broadcast (cond_t * cvar); 00033 void cond_wait (cond_t * cvar, struct mutex* mtx); 00034 int cond_wait_timeout (cond_t * cvar, mutex_t * mtx, const unsigned int usec); 00035 00036 00037 #endif /*CONDVAR_H_*/