lib/workqueue: Add trivial work_queue_is_scheduled helper

(cherry picked from commit 13c2a3db503fde67f647fa58fd4e1077517ebb5c)
This commit is contained in:
Paul Jakma 2015-09-15 16:16:42 +01:00 committed by Daniel Walton
parent 3ac45df164
commit 86582682c9
2 changed files with 8 additions and 0 deletions

View 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)
{

View 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;