summaryrefslogtreecommitdiffstats
path: root/testsuites/smptests/smpipi01/init.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-12-09 08:20:44 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-12-09 08:22:42 +0100
commit0e779a4c2e938e7e8a01670fe8a96d442415810e (patch)
tree6d52b8e00698c02737f54de2b34e505f6e5ff6ac /testsuites/smptests/smpipi01/init.c
parentspec: Move zynq-uart into its own object (diff)
downloadrtems-0e779a4c2e938e7e8a01670fe8a96d442415810e.tar.bz2
smptests/smpipi01: Fix sporadic test failure
Diffstat (limited to '')
-rw-r--r--testsuites/smptests/smpipi01/init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/testsuites/smptests/smpipi01/init.c b/testsuites/smptests/smpipi01/init.c
index 3ca04c7ffe..18b7a9ae17 100644
--- a/testsuites/smptests/smpipi01/init.c
+++ b/testsuites/smptests/smpipi01/init.c
@@ -118,6 +118,8 @@ static void test_send_message_while_processing_a_message(
for (cpu_index = 0; cpu_index < cpu_count; ++cpu_index) {
if (cpu_index != cpu_index_self) {
+ Per_CPU_Control *cpu_self;
+
ctx->jobs[0][0].context = &barrier_0_job_context;
_Per_CPU_Add_job(_Per_CPU_Get_by_index(cpu_index), &ctx->jobs[0][0]);
_SMP_Send_message(cpu_index, SMP_MESSAGE_PERFORM_JOBS);
@@ -142,6 +144,11 @@ static void test_send_message_while_processing_a_message(
rtems_test_assert(ctx->counters[cpu_index].value == 2);
ctx->counters[cpu_index].value = 0;
+
+ /* Ensure that the second job is done and can be reused */
+ cpu_self = _Thread_Dispatch_disable();
+ _Per_CPU_Wait_for_job(_Per_CPU_Get_by_index(cpu_index), &ctx->jobs[0][1]);
+ _Thread_Dispatch_enable(cpu_self);
}
}
}