提交 bfa35795 编写于 作者: 沙子屑耶's avatar 沙子屑耶 提交者: guo

[kernel] 当tick为0时rt_thread_sleep不应该挂起线程

上级 069086ae
......@@ -572,6 +572,11 @@ rt_err_t rt_thread_sleep(rt_tick_t tick)
rt_base_t level;
struct rt_thread *thread;
if (tick == 0)
{
return -RT_EINVAL;
}
/* set to current thread */
thread = rt_thread_self();
RT_ASSERT(thread != RT_NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册