[fix] 添加创建线程函数时间片参数检查 (#8807)

This commit is contained in:
Yaochenger 2024-04-16 21:59:08 +08:00 committed by GitHub
parent 96eabab698
commit 46f464a5e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -343,6 +343,7 @@ rt_err_t rt_thread_init(struct rt_thread *thread,
/* parameter check */
RT_ASSERT(thread != RT_NULL);
RT_ASSERT(stack_start != RT_NULL);
RT_ASSERT(tick != 0);
/* initialize thread object */
rt_object_init((rt_object_t)thread, RT_Object_Class_Thread, name);
@ -512,6 +513,9 @@ rt_thread_t rt_thread_create(const char *name,
rt_uint8_t priority,
rt_uint32_t tick)
{
/* parameter check */
RT_ASSERT(tick != 0);
struct rt_thread *thread;
void *stack_start;