[utest] 更改线程栈的大小,避免栈异常

This commit is contained in:
zhkag 2023-09-26 15:38:14 +08:00 committed by guo
parent 29a508222c
commit 82debed3ae
6 changed files with 18 additions and 18 deletions

View File

@ -16,7 +16,7 @@
#define THREAD_PRIORITY 25 #define THREAD_PRIORITY 25
#define THREAD_TIMESLICE 1 #define THREAD_TIMESLICE 1
#define THREAD_STACKSIZE 1024 #define THREAD_STACKSIZE UTEST_THR_STACK_SIZE
/* convenience macro - return either 64-bit or 32-bit value */ /* convenience macro - return either 64-bit or 32-bit value */
#define ATOMIC_WORD(val_if_64, val_if_32) \ #define ATOMIC_WORD(val_if_64, val_if_32) \

View File

@ -21,11 +21,11 @@ static rt_event_t dynamic_event = RT_NULL;
static rt_uint32_t dynamic_event_recv_thread_finish = 0, dynamic_event_send_thread_finish = 0; static rt_uint32_t dynamic_event_recv_thread_finish = 0, dynamic_event_send_thread_finish = 0;
rt_align(RT_ALIGN_SIZE) rt_align(RT_ALIGN_SIZE)
static char thread3_stack[1024]; static char thread3_stack[UTEST_THR_STACK_SIZE];
static struct rt_thread thread3; static struct rt_thread thread3;
rt_align(RT_ALIGN_SIZE) rt_align(RT_ALIGN_SIZE)
static char thread4_stack[1024]; static char thread4_stack[UTEST_THR_STACK_SIZE];
static struct rt_thread thread4; static struct rt_thread thread4;
#endif /* RT_USING_HEAP */ #endif /* RT_USING_HEAP */
@ -33,11 +33,11 @@ static rt_uint32_t recv_event_times1 = 0, recv_event_times2 = 0;
static rt_uint32_t static_event_recv_thread_finish = 0, static_event_send_thread_finish = 0; static rt_uint32_t static_event_recv_thread_finish = 0, static_event_send_thread_finish = 0;
rt_align(RT_ALIGN_SIZE) rt_align(RT_ALIGN_SIZE)
static char thread1_stack[1024]; static char thread1_stack[UTEST_THR_STACK_SIZE];
static struct rt_thread thread1; static struct rt_thread thread1;
rt_align(RT_ALIGN_SIZE) rt_align(RT_ALIGN_SIZE)
static char thread2_stack[1024]; static char thread2_stack[UTEST_THR_STACK_SIZE];
static struct rt_thread thread2; static struct rt_thread thread2;
#define THREAD_PRIORITY 9 #define THREAD_PRIORITY 9

View File

@ -21,11 +21,11 @@ static uint8_t static_mb_recv_thread_finish, static_mb_send_thread_finish;
static uint8_t dynamic_mb_recv_thread_finish, dynamic_mb_send_thread_finish; static uint8_t dynamic_mb_recv_thread_finish, dynamic_mb_send_thread_finish;
rt_align(RT_ALIGN_SIZE) rt_align(RT_ALIGN_SIZE)
static char thread1_stack[1024]; static char thread1_stack[UTEST_THR_STACK_SIZE];
static struct rt_thread thread1; static struct rt_thread thread1;
rt_align(RT_ALIGN_SIZE) rt_align(RT_ALIGN_SIZE)
static char thread2_stack[1024]; static char thread2_stack[UTEST_THR_STACK_SIZE];
static struct rt_thread thread2; static struct rt_thread thread2;
#define THREAD_PRIORITY 9 #define THREAD_PRIORITY 9
@ -315,7 +315,7 @@ static void test_dynamic_mailbox_send_recv(void)
mb_recv = rt_thread_create("mb_recv_thread", mb_recv = rt_thread_create("mb_recv_thread",
thread3_recv_dynamic_mb, thread3_recv_dynamic_mb,
RT_NULL, RT_NULL,
1024, UTEST_THR_STACK_SIZE,
THREAD_PRIORITY - 1, THREAD_PRIORITY - 1,
THREAD_TIMESLICE); THREAD_TIMESLICE);
if (mb_recv == RT_NULL) if (mb_recv == RT_NULL)
@ -327,7 +327,7 @@ static void test_dynamic_mailbox_send_recv(void)
mb_send = rt_thread_create("mb_send_thread", mb_send = rt_thread_create("mb_send_thread",
thread4_send_dynamic_mb, thread4_send_dynamic_mb,
RT_NULL, RT_NULL,
1024, UTEST_THR_STACK_SIZE,
THREAD_PRIORITY - 1, THREAD_PRIORITY - 1,
THREAD_TIMESLICE); THREAD_TIMESLICE);
if (mb_send == RT_NULL) if (mb_send == RT_NULL)

View File

@ -19,8 +19,8 @@ static rt_uint8_t mq_buf[RT_MQ_BUF_SIZE(MSG_SIZE, MAX_MSGS)];
static struct rt_thread mq_send_thread; static struct rt_thread mq_send_thread;
static struct rt_thread mq_recv_thread; static struct rt_thread mq_recv_thread;
static rt_uint8_t mq_send_stack[1024]; static rt_uint8_t mq_send_stack[UTEST_THR_STACK_SIZE];
static rt_uint8_t mq_recv_stack[1024]; static rt_uint8_t mq_recv_stack[UTEST_THR_STACK_SIZE];
static struct rt_event finish_e; static struct rt_event finish_e;
#define MQSEND_FINISH 0x01 #define MQSEND_FINISH 0x01

View File

@ -294,7 +294,7 @@ static void test_static_pri_reverse(void)
tid1 = rt_thread_create("thread1", tid1 = rt_thread_create("thread1",
static_thread1_entry, static_thread1_entry,
&static_mutex, &static_mutex,
1024, UTEST_THR_STACK_SIZE,
10 - 1, 10 - 1,
10); 10);
if (tid1 != RT_NULL) if (tid1 != RT_NULL)
@ -304,7 +304,7 @@ static void test_static_pri_reverse(void)
tid2 = rt_thread_create("thread2", tid2 = rt_thread_create("thread2",
static_thread2_entry, static_thread2_entry,
&static_mutex, &static_mutex,
1024, UTEST_THR_STACK_SIZE,
10, 10,
10); 10);
if (tid2 != RT_NULL) if (tid2 != RT_NULL)
@ -314,7 +314,7 @@ static void test_static_pri_reverse(void)
tid3 = rt_thread_create("thread3", tid3 = rt_thread_create("thread3",
static_thread3_entry, static_thread3_entry,
&static_mutex, &static_mutex,
1024, UTEST_THR_STACK_SIZE,
10 + 1, 10 + 1,
10); 10);
if (tid3 != RT_NULL) if (tid3 != RT_NULL)
@ -603,7 +603,7 @@ static void test_dynamic_pri_reverse(void)
tid1 = rt_thread_create("thread1", tid1 = rt_thread_create("thread1",
dynamic_thread1_entry, dynamic_thread1_entry,
dynamic_mutex, dynamic_mutex,
1024, UTEST_THR_STACK_SIZE,
10 - 1, 10 - 1,
10); 10);
if (tid1 != RT_NULL) if (tid1 != RT_NULL)
@ -613,7 +613,7 @@ static void test_dynamic_pri_reverse(void)
tid2 = rt_thread_create("thread2", tid2 = rt_thread_create("thread2",
dynamic_thread2_entry, dynamic_thread2_entry,
dynamic_mutex, dynamic_mutex,
1024, UTEST_THR_STACK_SIZE,
10, 10,
10); 10);
if (tid2 != RT_NULL) if (tid2 != RT_NULL)
@ -623,7 +623,7 @@ static void test_dynamic_pri_reverse(void)
tid3 = rt_thread_create("thread3", tid3 = rt_thread_create("thread3",
dynamic_thread3_entry, dynamic_thread3_entry,
dynamic_mutex, dynamic_mutex,
1024, UTEST_THR_STACK_SIZE,
10 + 1, 10 + 1,
10); 10);
if (tid3 != RT_NULL) if (tid3 != RT_NULL)

View File

@ -17,7 +17,7 @@
#define THREAD_TIMESLICE 10 #define THREAD_TIMESLICE 10
rt_align(RT_ALIGN_SIZE) rt_align(RT_ALIGN_SIZE)
static char thread2_stack[1024]; static char thread2_stack[UTEST_THR_STACK_SIZE];
static struct rt_thread thread2; static struct rt_thread thread2;
#ifdef RT_USING_HEAP #ifdef RT_USING_HEAP
static rt_thread_t tid1 = RT_NULL; static rt_thread_t tid1 = RT_NULL;