1 #ifndef __LUNAIX_CODVAR_H
2 #define __LUNAIX_CODVAR_H
4 #include <lunaix/ds/llist.h>
5 #include <lunaix/sched.h>
9 struct llist_header waiters;
13 waitq_init(waitq_t* waitq)
15 llist_init_head(&waitq->waiters);
19 waitq_empty(waitq_t* waitq)
21 return llist_empty(&waitq->waiters);
25 pwait(waitq_t* queue);
28 pwake_one(waitq_t* queue);
31 pwake_all(waitq_t* queue);
33 #define wait_if(cond) \
38 #endif /* __LUNAIX_CODVAR_H */