Skip to content

Commit 317bd5a

Browse files
committed
[docs][utest]:Add comments for smp_thread_preemption
Add comments for smp_thread_preemption. Signed-off-by: Mengchen Teng <[email protected]>
1 parent 05846c6 commit 317bd5a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/utest/smp/smp_thread_preemption_tc.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,29 @@
1717
* @note Create multiple threads, low-priority threads run first,
1818
* high-priority threads preempt low-priority threads, and
1919
* print the current status of each core in the thread's entry function.
20+
*
21+
* Test Case Name: [smp_thread_preemptions]
22+
*
23+
* Test Objectives:
24+
* - Test the thread preemption logic under the SMP architecture
25+
*
26+
* Test Scenarios:
27+
* - A high-priority thread thigh and a low-priority thread tlow are created. Since tlow is created
28+
* - prior to thigh, it prints the thread list information first and then waits for the finish_flag
29+
* - bit. Once thigh becomes ready, it preempts tlow, prints the thread list, and then sets the
30+
* - finish_flag bit. After that, tlow exits the busy-wait loop.
31+
*
32+
* Verification Metrics:
33+
* - First, the message "Low priority thread is running" will be displayed, followed immediately by
34+
* - a thread_list information list. Subsequently, the message "High priority thread is running" will
35+
* - appear, and in the thread_list that follows, the tlow thread can be observed in the ready state.
36+
*
37+
* Dependencies:
38+
* - Enable RT_USING_SMP, set RT_THREAD_PRIORITY_MAX = 256.
39+
*
40+
* Expected Results:
41+
* - You will see the message "[ PASSED ] [ result ] testcase (core.smp_thread_preemptions)", and observe
42+
* - the tlow thread in the ready state in the thread_list printed by the thigh thread.
2043
*/
2144

2245
#define THREAD_PRIORITY_HIGH 21

0 commit comments

Comments
 (0)