summaryrefslogtreecommitdiff
path: root/src/utest
diff options
context:
space:
mode:
authorTm-C-mT <[email protected]>2025-12-09 21:57:04 +0800
committerR b b666 <[email protected]>2025-12-10 17:06:41 +0800
commitd9ca9c449b7aaa48a26e2860f8755d5a18fc94e7 (patch)
tree579b9559604ed2ea96243a3f41b53dc7c69d2a65 /src/utest
parentd56d3d95d508950b40bb646685ae8f583de1f7e9 (diff)
[docs][utest]:Add comments for smp_thread_preemption
Add comments for smp_thread_preemption. Signed-off-by: Mengchen Teng <[email protected]>
Diffstat (limited to 'src/utest')
-rw-r--r--src/utest/smp/smp_thread_preemption_tc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/utest/smp/smp_thread_preemption_tc.c b/src/utest/smp/smp_thread_preemption_tc.c
index f975217427..b8493d9be2 100644
--- a/src/utest/smp/smp_thread_preemption_tc.c
+++ b/src/utest/smp/smp_thread_preemption_tc.c
@@ -18,6 +18,28 @@
* high-priority threads preempt low-priority threads, and
* print the current status of each core in the thread's entry function.
*
+ * Test Case Name: [smp_thread_preemptions]
+ *
+ * Test Objectives:
+ * - Test the thread preemption logic under the SMP architecture
+ *
+ * Test Scenarios:
+ * - A high-priority thread thigh and a low-priority thread tlow are created. Since tlow is created
+ * - prior to thigh, it prints the thread list information first and then waits for the finish_flag
+ * - bit. Once thigh becomes ready, it preempts tlow, prints the thread list, and then sets the
+ * - finish_flag bit. After that, tlow exits the busy-wait loop.
+ *
+ * Verification Metrics:
+ * - First, the message "Low priority thread is running" will be displayed, followed immediately by
+ * - a thread_list information list. Subsequently, the message "High priority thread is running" will
+ * - appear, and in the thread_list that follows, the tlow thread can be observed in the ready state.
+ *
+ * Dependencies:
+ * - Enable RT_USING_SMP, set RT_THREAD_PRIORITY_MAX = 256.
+ *
+ * Expected Results:
+ * - You will see the message "[ PASSED ] [ result ] testcase (core.smp_thread_preemptions)", and observe
+ * - the tlow thread in the ready state in the thread_list printed by the thigh thread.
*/
#define THREAD_PRIORITY_HIGH 21