diff options
author | Paul Jakma <paul@jakma.org> | 2015-09-15 16:16:42 +0100 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2015-09-24 15:26:42 +0100 |
commit | 13c2a3db503fde67f647fa58fd4e1077517ebb5c (patch) | |
tree | 506bead8b2040e9c216f18e76df3091a5924a31f | |
parent | e8441a81f6c9f73bc8a25669003abffb40066703 (diff) | |
download | quagga-13c2a3db503fde67f647fa58fd4e1077517ebb5c.tar.bz2 quagga-13c2a3db503fde67f647fa58fd4e1077517ebb5c.tar.xz |
lib/workqueue: Add trivial work_queue_is_scheduled helper
-rw-r--r-- | lib/workqueue.c | 6 | ||||
-rw-r--r-- | lib/workqueue.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/workqueue.c b/lib/workqueue.c index e09d009f..9fc89314 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -107,6 +107,12 @@ work_queue_free (struct work_queue *wq) 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 f59499a0..5ad25893 100644 --- a/lib/workqueue.h +++ b/lib/workqueue.h @@ -119,6 +119,8 @@ extern void work_queue_plug (struct work_queue *wq); /* 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; |