4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-19 11:43:29 +08:00

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

This commit is contained in:
Ylne 2022-08-30 16:22:27 +08:00 committed by guo
parent 069086ae28
commit bfa357958d

View File

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