[workqueue] 队列销毁时取消所有工作并释放内核对象

This commit is contained in:
tangyuxin 2021-02-06 20:15:50 +08:00
parent d6b44ca52e
commit 3ef3fb50af
1 changed files with 2 additions and 0 deletions

View File

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