summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-01-14 07:34:44 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-01-14 07:40:49 +0100
commit77c5ddd4967d418855fb5251b3f16af4010717f3 (patch)
tree3d54d865a17e38a9f82d3595175f9a8e2677fab4
parenttools/cpu/nios2/ptf.c: Add include to fix warnings (diff)
downloadrtems-77c5ddd4967d418855fb5251b3f16af4010717f3.tar.bz2
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).
-rw-r--r--testsuites/smptests/smpmrsp01/init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/testsuites/smptests/smpmrsp01/init.c b/testsuites/smptests/smpmrsp01/init.c
index f01caead1a..a1aae86276 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)