forked from Imagelibrary/rtems
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).
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user