Second Extended Filesystem (ext2) and other improvements (#33)
[lunaix-os.git] / lunaix-os / includes / lunaix / ds / waitq.h
index dfeb7c377893cdae489521b7c93f6cd8b7c23d29..4469e1ca5689d2cc7441fd32a262d9f426c97431 100644 (file)
@@ -8,15 +8,39 @@ typedef struct waitq
     struct llist_header waiters;
 } waitq_t;
 
-inline void
+static inline void
 waitq_init(waitq_t* waitq)
 {
     llist_init_head(&waitq->waiters);
 }
 
+static inline int
+waitq_empty(waitq_t* waitq)
+{
+    return llist_empty(&waitq->waiters);
+}
+
+static inline void
+waitq_cancel_wait(waitq_t* waitq)
+{
+    llist_delete(&waitq->waiters);
+}
+
+void
+prepare_to_wait(waitq_t* waitq);
+
+void
+try_wait();
+
+void
+try_wait_check_stall();
+
 void
 pwait(waitq_t* queue);
 
+void
+pwait_check_stall(waitq_t* queue);
+
 void
 pwake_one(waitq_t* queue);