regression: test serial port r/w.
[lunaix-os.git] / lunaix-os / includes / lunaix / ds / waitq.h
index 4014d0509a69a44264921525141da52d9888398e..219bf049d0340e96505cce52d715bb7befd50936 100644 (file)
@@ -2,6 +2,7 @@
 #define __LUNAIX_CODVAR_H
 
 #include <lunaix/ds/llist.h>
+#include <lunaix/sched.h>
 
 typedef struct waitq
 {
@@ -29,4 +30,9 @@ pwake_one(waitq_t* queue);
 void
 pwake_all(waitq_t* queue);
 
+#define wait_if(cond)                                                          \
+    while ((cond)) {                                                           \
+        sched_yieldk();                                                        \
+    }
+
 #endif /* __LUNAIX_CODVAR_H */