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-09 15:47:12 +0100
commita903a6883ed6997fdee03f3b37fdbfbcaf6ef597 (patch)
treec2af1a904efee5045f06183352d436f8e41d9821
parent26841e92114a3e6770da054414e635b0d2e9a32c (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