]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib/workqueue: Add trivial work_queue_is_scheduled helper
authorPaul Jakma <paul@jakma.org>
Tue, 15 Sep 2015 15:16:42 +0000 (16:16 +0100)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 3 Jun 2016 20:39:22 +0000 (20:39 +0000)
(cherry picked from commit 13c2a3db503fde67f647fa58fd4e1077517ebb5c)

lib/workqueue.c
lib/workqueue.h

index a45a6fc09748c1567e2ae697843c1fe7c0823cf3..3100b993831bf32a1da6626303d75d1fff0f8bfb 100644 (file)
@@ -108,6 +108,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)
 {
index 7d9a877d103da26a2d9e968513f04b28a7faa5e3..19b44041d786d3da21e33a611bcfa3dafa779db6 100644 (file)
@@ -122,6 +122,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;