summaryrefslogtreecommitdiff
path: root/components/drivers/src/workqueue.c
diff options
context:
space:
mode:
authortangyuxin <[email protected]>2021-02-06 20:15:50 +0800
committertangyuxin <[email protected]>2021-02-06 20:15:50 +0800
commit3ef3fb50afdb388918fe7514d287aca753030f27 (patch)
tree29878fc4942d1214fc689ac31375a7fd41c9aab6 /components/drivers/src/workqueue.c
parentd6b44ca52ed2ddc27e447ae2fe2914b9eb38687f (diff)
[workqueue] 队列销毁时取消所有工作并释放内核对象
Diffstat (limited to 'components/drivers/src/workqueue.c')
-rw-r--r--components/drivers/src/workqueue.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/components/drivers/src/workqueue.c b/components/drivers/src/workqueue.c
index eb6cefc006..474eae556b 100644
--- a/components/drivers/src/workqueue.c
+++ b/components/drivers/src/workqueue.c
@@ -231,7 +231,9 @@ rt_err_t rt_workqueue_destroy(struct rt_workqueue *queue)
{
RT_ASSERT(queue != RT_NULL);
+ rt_workqueue_cancel_all_work();
rt_thread_delete(queue->work_thread);
+ rt_sem_detach(&(queue->sem));
RT_KERNEL_FREE(queue);
return RT_EOK;