Commit 9319fde
committed
[utest]: Modify the utest logic for thread allocation of idle harts
Currently, this utest cannot determine whether threads are evenly distributed
across idle harts by observing the result of list_thread(). This is because
the presence of rt_thread_delay(5); causes all other threads to be in the
suspended state when thread information is printed. For example, if RT_CPUS_NR=4,
T0 executes list_thread() to print information, while T1~T3 are in hibernation
and thus it is impossible to observe which hart they are running on.
Solution:Here, the completion judgment condition has been modified. For example,
when RT_CPUS_NR=4, only RT_CPUS_NR-1 threads will be created (i.e., T0 to T2),
because running the utest occupies one hart. The execution is judged as completed
when finish_flag=0x0007, and the thread running the utest will call list_thread()
to print the information. Observe whether T0 to T2 are running on different
harts simultaneously.
Signed-off-by: Mengchen Teng <[email protected]>1 parent 30e1e5e commit 9319fde
1 file changed
+15
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
41 | | - | |
42 | 39 | | |
43 | 40 | | |
44 | 41 | | |
| |||
54 | 51 | | |
55 | 52 | | |
56 | 53 | | |
57 | | - | |
58 | | - | |
| 54 | + | |
| 55 | + | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
| |||
66 | 63 | | |
67 | 64 | | |
68 | 65 | | |
69 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | | - | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| 94 | + | |
0 commit comments