summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spintrcritical20
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-24 12:02:20 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-19 12:00:45 +0200
commitcc366ec8c9ecaab838a745175a0d53a7a5db437e (patch)
tree330c714baf220f30a07ea57bd08c545a072a12d3 /testsuites/sptests/spintrcritical20
parentscore: More thread queue operations (diff)
downloadrtems-cc366ec8c9ecaab838a745175a0d53a7a5db437e.tar.bz2
score: New thread queue implementation
Use thread wait flags for synchronization. The enqueue operation is now part of the initial critical section. This is the key change and enables fine grained locking on SMP for objects using a thread queue like semaphores and message queues. Update #2273.
Diffstat (limited to 'testsuites/sptests/spintrcritical20')
-rw-r--r--testsuites/sptests/spintrcritical20/init.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/testsuites/sptests/spintrcritical20/init.c b/testsuites/sptests/spintrcritical20/init.c
index daa8ac7f7e..7e52211742 100644
--- a/testsuites/sptests/spintrcritical20/init.c
+++ b/testsuites/sptests/spintrcritical20/init.c
@@ -44,6 +44,10 @@ static void semaphore_task(rtems_task_argument arg)
test_context *ctx = (test_context *) arg;
ctx->semaphore_task_tcb = _Thread_Get_executing();
+ _Thread_Wait_set_timeout_code(
+ ctx->semaphore_task_tcb,
+ CORE_SEMAPHORE_TIMEOUT
+ );
while (true) {
rtems_status_code sc = rtems_semaphore_obtain(
@@ -87,7 +91,7 @@ static bool test_body(void *arg)
ctx->thread_queue_was_null = true;
}
- _Thread_queue_Process_timeout(ctx->semaphore_task_tcb);
+ _Thread_Timeout(0, ctx->semaphore_task_tcb);
switch (ctx->semaphore_task_tcb->Wait.return_code) {
case CORE_SEMAPHORE_STATUS_SUCCESSFUL:
@@ -103,7 +107,9 @@ static bool test_body(void *arg)
_Thread_Enable_dispatch();
- return false;
+ return ctx->thread_queue_was_null
+ && ctx->status_was_successful
+ && ctx->status_was_timeout;
}
static void Init(rtems_task_argument ignored)