summaryrefslogtreecommitdiff
path: root/lib/workqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/workqueue.c')
-rw-r--r--lib/workqueue.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/workqueue.c b/lib/workqueue.c
index d4ff3ee6ce..1af51c06c1 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -101,7 +101,7 @@ struct work_queue *work_queue_new(struct thread_master *m,
return new;
}
-void work_queue_free(struct work_queue *wq)
+void work_queue_free_original(struct work_queue *wq)
{
if (wq->thread != NULL)
thread_cancel(wq->thread);
@@ -119,6 +119,12 @@ void work_queue_free(struct work_queue *wq)
return;
}
+void work_queue_free_and_null(struct work_queue **wq)
+{
+ work_queue_free_original(*wq);
+ *wq = NULL;
+}
+
bool work_queue_is_scheduled(struct work_queue *wq)
{
return (wq->thread != NULL);