提交 62137eec 编写于 作者: 张世争

[update][kernel]规范rt_object_detach的使用

上级 fae0fa8e
......@@ -382,19 +382,8 @@ rt_err_t rt_thread_detach(rt_thread_t thread)
/* change stat */
thread->stat = RT_THREAD_CLOSE;
if (rt_object_is_systemobject((rt_object_t)thread) == RT_TRUE)
{
rt_object_detach((rt_object_t)thread);
}
else
{
/* disable interrupt */
lock = rt_hw_interrupt_disable();
/* insert to defunct thread list */
rt_list_insert_after(&rt_thread_defunct, &(thread->tlist));
/* enable interrupt */
rt_hw_interrupt_enable(lock);
}
/* detach thread object */
rt_object_detach((rt_object_t)thread);
return RT_EOK;
}
......
......@@ -233,7 +233,7 @@ rt_err_t rt_timer_detach(rt_timer_t timer)
/* enable interrupt */
rt_hw_interrupt_enable(level);
rt_object_detach((rt_object_t)timer);
rt_object_detach(&(timer->parent));
return RT_EOK;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册