diff options
Diffstat (limited to 'testsuites/validation/tc-sem-uni.c')
-rw-r--r-- | testsuites/validation/tc-sem-uni.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/testsuites/validation/tc-sem-uni.c b/testsuites/validation/tc-sem-uni.c index cd711a6969..08c38adb6c 100644 --- a/testsuites/validation/tc-sem-uni.c +++ b/testsuites/validation/tc-sem-uni.c @@ -104,6 +104,23 @@ typedef struct { static RtemsSemValUni_Context RtemsSemValUni_Instance; +typedef RtemsSemValUni_Context Context; + +static void ObtainReleaseMrsPTask( rtems_task_argument arg ) +{ + Context *ctx; + + ctx = (Context *) arg; + ObtainMutex( ctx->mutex_id ); + ObtainMutex( ctx->mutex_2_id ); + ctx->counter = 1; + Yield(); + ReleaseMutex( ctx->mutex_2_id ); + ReleaseMutex( ctx->mutex_id ); + ctx->counter = 2; + (void) ReceiveAnyEvents(); +} + static void RtemsSemValUni_Setup( RtemsSemValUni_Context *ctx ) { SetSelfPriority( PRIO_NORMAL ); @@ -138,23 +155,6 @@ static T_fixture RtemsSemValUni_Fixture = { .initial_context = &RtemsSemValUni_Instance }; -typedef RtemsSemValUni_Context Context; - -static void ObtainReleaseMrsPTask( rtems_task_argument arg ) -{ - Context *ctx; - - ctx = (Context *) arg; - ObtainMutex( ctx->mutex_id ); - ObtainMutex( ctx->mutex_2_id ); - ctx->counter = 1; - Yield(); - ReleaseMutex( ctx->mutex_2_id ); - ReleaseMutex( ctx->mutex_id ); - ctx->counter = 2; - (void) ReceiveAnyEvents(); -} - /** * @brief Create a worker thread and two MrsP mutexes. Obtain the Mrsp mutexes * and check that a task yield works (owner is not sticky). We need two |