mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-19 18:33:32 +08:00
[fix] 添加创建线程函数时间片参数检查 (#8807)
This commit is contained in:
parent
96eabab698
commit
46f464a5e0
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user