about summary refs log tree commit homepage
path: root/ioq.c
diff options
context:
space:
mode:
Diffstat (limited to 'ioq.c')
-rw-r--r--ioq.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ioq.c b/ioq.c
index 0b36e65..028b225 100644
--- a/ioq.c
+++ b/ioq.c
@@ -41,6 +41,7 @@ bool mog_ioq_ready(struct mog_ioq *ioq, struct mog_fd *client_mfd)
                 ioq->cur--;
                 mog_ioq_current = ioq;
         } else {
+                client_mfd->ioq_blocked = 1;
                 SIMPLEQ_INSERT_TAIL(&ioq->ioq_head, client_mfd, ioqent);
         }
 
@@ -88,3 +89,12 @@ void mog_ioq_destroy(struct mog_ioq *ioq)
 {
         CHECK(int, 0, pthread_mutex_destroy(&ioq->mtx));
 }
+
+bool mog_ioq_unblock(struct mog_fd *mfd)
+{
+        if (mfd->ioq_blocked == 0)
+                return false;
+
+        mfd->ioq_blocked = 0;
+        return true;
+}