lib/workqueue: Add trivial work_queue_is_scheduled helper
diff --git a/lib/workqueue.c b/lib/workqueue.c
index e09d009..9fc8931 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -107,6 +107,12 @@
return;
}
+bool
+work_queue_is_scheduled (struct work_queue *wq)
+{
+ return (wq->thread != NULL);
+}
+
static int
work_queue_schedule (struct work_queue *wq, unsigned int delay)
{
diff --git a/lib/workqueue.h b/lib/workqueue.h
index f59499a..5ad2589 100644
--- a/lib/workqueue.h
+++ b/lib/workqueue.h
@@ -119,6 +119,8 @@
/* unplug the queue, allow it to be drained again */
extern void work_queue_unplug (struct work_queue *wq);
+bool work_queue_is_scheduled (struct work_queue *);
+
/* Helpers, exported for thread.c and command.c */
extern int work_queue_run (struct thread *);
extern struct cmd_element show_work_queues_cmd;