Skip to content

Commit 5d4f819

Browse files
YaochengerRbb666
authored andcommitted
[add] 修改线程栈大小为UTEST_THR_STACK_SIZE
1 parent f33312a commit 5d4f819

6 files changed

+8
-7
lines changed

examples/utest/testcases/kernel/smp/smp_affinity_pri1_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/* Number of thread runs */
2424
static int run_num = 10;
25-
#define THREAD_STACK_SIZE 1024
25+
#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE
2626
#define THREAD_PRIORITY 2
2727
#define LOW_PRIORITY 50
2828
#define THIGH_PRIORITY 10

examples/utest/testcases/kernel/smp/smp_affinity_pri2_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/* Number of thread runs */
2424
static int run_num = 10;
25-
#define THREAD_STACK_SIZE 1024
25+
#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE
2626
#define THREAD_PRIORITY 2
2727
#define LOW_PRIORITY 50
2828
#define THIGH_PRIORITY 10

examples/utest/testcases/kernel/smp/smp_assigned_idle_cores_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* running on each core.
2020
*/
2121

22-
#define THREAD_STACK_SIZE 1024
22+
#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE
2323
#define THREAD_PRIORITY 20
2424
static rt_thread_t threads[RT_CPUS_NR];
2525
static int tick = 0, finsh_flag = 0;

examples/utest/testcases/kernel/smp/smp_bind_affinity_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
/* Number of thread runs */
2323
static int run_num = 100;
24-
#define THREAD_STACK_SIZE 1024
24+
#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE
2525
#define THREAD_PRIORITY 20
2626
static rt_thread_t threads[RT_CPUS_NR];
2727
static struct rt_spinlock lock;

examples/utest/testcases/kernel/smp/smp_spinlock_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#define THREAD_PRIORITY 20
2222
#define THREAD_TIMESLICE 20
23-
#define THREAD_STACK_SIZE 1024
23+
#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE
2424
static rt_thread_t thread1;
2525
static rt_thread_t thread2;
2626
static rt_uint8_t finsh_flag = 0;

examples/utest/testcases/kernel/smp/smp_thread_preemption_tc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#define THREAD_PRIORITY_HIGH 21
2323
#define THREAD_PRIORITY_LOW 30
24+
#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE
2425

2526
static rt_thread_t threads[2];
2627
static struct rt_spinlock lock;
@@ -50,7 +51,7 @@ static void thread_low_entry(void *parameter)
5051
static void thread_preemptions_tc(void)
5152
{
5253
/* Creating low-priority thread */
53-
threads[0] = rt_thread_create("tlow", thread_low_entry, RT_NULL, 1024, THREAD_PRIORITY_LOW, 10);
54+
threads[0] = rt_thread_create("tlow", thread_low_entry, RT_NULL, THREAD_STACK_SIZE, THREAD_PRIORITY_LOW, 10);
5455
if (threads[0] != RT_NULL)
5556
{
5657
uassert_true(1);
@@ -59,7 +60,7 @@ static void thread_preemptions_tc(void)
5960

6061
rt_thread_delay(5);
6162
/* Creating high-priority thread */
62-
threads[1] = rt_thread_create("thigh", thread_high_entry, RT_NULL, 1024, THREAD_PRIORITY_HIGH, 10);
63+
threads[1] = rt_thread_create("thigh", thread_high_entry, RT_NULL, THREAD_STACK_SIZE, THREAD_PRIORITY_HIGH, 10);
6364
if (threads[1] != RT_NULL)
6465
{
6566
uassert_true(1);

0 commit comments

Comments
 (0)