summaryrefslogtreecommitdiff
path: root/lib/workqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/workqueue.c')
-rw-r--r--lib/workqueue.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/workqueue.c b/lib/workqueue.c
index 24ef24c774..fa69ec600e 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -99,8 +99,10 @@ struct work_queue *work_queue_new(struct thread_master *m,
return new;
}
-void work_queue_free_original(struct work_queue *wq)
+void work_queue_free_and_null(struct work_queue **wqp)
{
+ struct work_queue *wq = *wqp;
+
if (wq->thread != NULL)
thread_cancel(wq->thread);
@@ -114,13 +116,8 @@ void work_queue_free_original(struct work_queue *wq)
XFREE(MTYPE_WORK_QUEUE_NAME, wq->name);
XFREE(MTYPE_WORK_QUEUE, wq);
- return;
-}
-void work_queue_free_and_null(struct work_queue **wq)
-{
- work_queue_free_original(*wq);
- *wq = NULL;
+ *wqp = NULL;
}
bool work_queue_is_scheduled(struct work_queue *wq)