From 46f464a5e0add65023e10557cc68a6af4f3f4be2 Mon Sep 17 00:00:00 2001 From: Yaochenger <75192526+Yaochenger@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:59:08 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E6=B7=BB=E5=8A=A0=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E5=87=BD=E6=95=B0=E6=97=B6=E9=97=B4=E7=89=87?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=A3=80=E6=9F=A5=20(#8807)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/thread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/thread.c b/src/thread.c index d220d490e2..1b489cf76f 100644 --- a/src/thread.c +++ b/src/thread.c @@ -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;