diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-24 12:02:20 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-19 12:00:45 +0200 |
commit | cc366ec8c9ecaab838a745175a0d53a7a5db437e (patch) | |
tree | 330c714baf220f30a07ea57bd08c545a072a12d3 /testsuites/sptests/spintrcritical22/init.c | |
parent | score: More thread queue operations (diff) | |
download | rtems-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/spintrcritical22/init.c')
-rw-r--r-- | testsuites/sptests/spintrcritical22/init.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/testsuites/sptests/spintrcritical22/init.c b/testsuites/sptests/spintrcritical22/init.c index 93946c39c5..1a377f7838 100644 --- a/testsuites/sptests/spintrcritical22/init.c +++ b/testsuites/sptests/spintrcritical22/init.c @@ -52,14 +52,18 @@ static void release_semaphore(rtems_id timer, void *arg) rtems_status_code sc; CORE_mutex_Control *mtx = &ctx->semaphore_control->Core_control.mutex; - if (mtx->Wait_queue.sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { + if ( + _Thread_Wait_flags_get(ctx->main_task_control) + == (THREAD_WAIT_CLASS_OBJECT | THREAD_WAIT_STATE_INTEND_TO_BLOCK) + ) { ctx->done = true; sc = rtems_semaphore_release(ctx->semaphore_id); rtems_test_assert(sc == RTEMS_SUCCESSFUL); rtems_test_assert( - mtx->Wait_queue.sync_state == THREAD_BLOCKING_OPERATION_SATISFIED + _Thread_Wait_flags_get(ctx->main_task_control) + == (THREAD_WAIT_CLASS_OBJECT | THREAD_WAIT_STATE_READY_AGAIN) ); rtems_test_assert(mtx->nest_count == 1); rtems_test_assert(mtx->holder == ctx->main_task_control); |