提交 4434c87a 编写于 作者: G Grissiom

TC: release the sem in cleanup

The sem that has been created should be deleted. The sem that has been
inited should be detached.
上级 e9e8e3f3
......@@ -100,6 +100,12 @@ static void _tc_cleanup()
rt_thread_delete(t2);
rt_thread_delete(worker);
if (sem)
{
rt_sem_delete(sem);
sem = RT_NULL;
}
if (t1_count > t2_count)
tc_done(TC_STAT_FAILED);
else
......
......@@ -119,6 +119,10 @@ static void _tc_cleanup()
/* 调度器上锁,上锁后,将不再切换到其他线程,仅响应中断 */
rt_enter_critical();
rt_sem_detach(&sem_lock);
rt_sem_detach(&sem_empty);
rt_sem_detach(&sem_full);
/* 删除线程 */
if (producer_tid != RT_NULL && producer_tid->stat != RT_THREAD_CLOSE)
rt_thread_delete(producer_tid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册