[rtems commit] smptests/smpmrsp01: Fix task delete race condition

Sebastian Huber sebh at rtems.org
Wed Jan 14 06:41:59 UTC 2015


Module:    rtems
Branch:    master
Commit:    77c5ddd4967d418855fb5251b3f16af4010717f3
Changeset: http://git.rtems.org/rtems/commit/?id=77c5ddd4967d418855fb5251b3f16af4010717f3

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jan 14 07:34:44 2015 +0100

smptests/smpmrsp01: Fix task delete race condition

Do not supsend self while waiting for termination since the
rtems_task_delete() may take place while the rtems_task_suspend() waits
for the Giant lock preventing delivery of the inter-processor interrupt.
The result is a suspended and terminated thread (this is a valid state,
but leads in this case to a test failure).

---

 testsuites/smptests/smpmrsp01/init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/testsuites/smptests/smpmrsp01/init.c b/testsuites/smptests/smpmrsp01/init.c
index f01caea..a1aae86 100644
--- a/testsuites/smptests/smpmrsp01/init.c
+++ b/testsuites/smptests/smpmrsp01/init.c
@@ -275,8 +275,9 @@ static void obtain_and_release_worker(rtems_task_argument arg)
   /* Worker done (H) */
   barrier(ctx, &barrier_state);
 
-  rtems_task_suspend(RTEMS_SELF);
-  rtems_test_assert(0);
+  while (true) {
+    /* Wait for termination */
+  }
 }
 
 static void test_mrsp_obtain_and_release(test_context *ctx)




More information about the vc mailing list