summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-08 11:16:49 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-11 17:05:09 +0100
commit53b31f9fc24e4cbb1553ccf1b63a670137375062 (patch)
tree8a8b94546ae629e3b4c0af4a92f998af376cb0aa
parent2be74e7655346e6982944f465a5fff677cc4c0c6 (diff)
testsuites/validation/tc-sem-uni.c
-rw-r--r--testsuites/validation/tc-sem-uni.c34
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