diff --git a/src/thread.c b/src/thread.c index e0c245f929..df6de24275 100644 --- a/src/thread.c +++ b/src/thread.c @@ -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);