From 9a448aabe65f2b85c7721098a3f68f0a99a6728b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 23 Dec 2016 16:02:07 +0100 Subject: score: Add STATES_THREAD_QUEUE_WITH_IDENTIFIER Add thread state bit to identify thread queues that are embedded in an object with identifier. --- cpukit/score/src/condition.c | 2 +- cpukit/score/src/corebarrierwait.c | 2 +- cpukit/score/src/coremsgseize.c | 2 +- cpukit/score/src/coremsgsubmit.c | 2 +- cpukit/score/src/coremutexseize.c | 2 +- cpukit/score/src/corerwlockobtainread.c | 2 +- cpukit/score/src/corerwlockobtainwrite.c | 2 +- cpukit/score/src/futex.c | 2 +- cpukit/score/src/mutex.c | 2 +- cpukit/score/src/semaphore.c | 2 +- cpukit/score/src/threadwaitgetid.c | 10 +--------- 11 files changed, 11 insertions(+), 19 deletions(-) (limited to 'cpukit/score/src') diff --git a/cpukit/score/src/condition.c b/cpukit/score/src/condition.c index cf929144b3..3c3a01141c 100644 --- a/cpukit/score/src/condition.c +++ b/cpukit/score/src/condition.c @@ -111,7 +111,7 @@ static Thread_Control *_Condition_Do_wait( executing = _Condition_Queue_acquire_critical( condition, &context->Base ); _Thread_queue_Context_set_thread_state( &context->Base, - STATES_WAITING_FOR_SYS_LOCK_CONDITION + STATES_WAITING_FOR_CONDITION_VARIABLE ); _Thread_queue_Context_set_enqueue_callout( &context->Base, diff --git a/cpukit/score/src/corebarrierwait.c b/cpukit/score/src/corebarrierwait.c index f47c039e7b..9cce4cfa56 100644 --- a/cpukit/score/src/corebarrierwait.c +++ b/cpukit/score/src/corebarrierwait.c @@ -46,7 +46,7 @@ Status_Control _CORE_barrier_Seize( the_barrier->number_of_waiting_threads = number_of_waiting_threads; _Thread_queue_Context_set_thread_state( queue_context, - STATES_WAITING_FOR_BARRIER + STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_BARRIER ); _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context ); _Thread_queue_Enqueue( diff --git a/cpukit/score/src/coremsgseize.c b/cpukit/score/src/coremsgseize.c index b48a3f93d7..98a7b156d4 100644 --- a/cpukit/score/src/coremsgseize.c +++ b/cpukit/score/src/coremsgseize.c @@ -115,7 +115,7 @@ Status_Control _CORE_message_queue_Seize( _Thread_queue_Context_set_thread_state( queue_context, - STATES_WAITING_FOR_MESSAGE + STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_MESSAGE ); _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context ); _Thread_queue_Enqueue( diff --git a/cpukit/score/src/coremsgsubmit.c b/cpukit/score/src/coremsgsubmit.c index 3c961014e3..5a8827a843 100644 --- a/cpukit/score/src/coremsgsubmit.c +++ b/cpukit/score/src/coremsgsubmit.c @@ -133,7 +133,7 @@ Status_Control _CORE_message_queue_Submit( _Thread_queue_Context_set_thread_state( queue_context, - STATES_WAITING_FOR_MESSAGE + STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_MESSAGE ); _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context ); _Thread_queue_Enqueue( diff --git a/cpukit/score/src/coremutexseize.c b/cpukit/score/src/coremutexseize.c index 4309380627..b00cad9707 100644 --- a/cpukit/score/src/coremutexseize.c +++ b/cpukit/score/src/coremutexseize.c @@ -34,7 +34,7 @@ Status_Control _CORE_mutex_Seize_slow( if ( wait ) { _Thread_queue_Context_set_thread_state( queue_context, - STATES_WAITING_FOR_MUTEX + STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_MUTEX ); _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context ); _Thread_queue_Context_set_deadlock_callout( diff --git a/cpukit/score/src/corerwlockobtainread.c b/cpukit/score/src/corerwlockobtainread.c index 641945635f..035b1d59ae 100644 --- a/cpukit/score/src/corerwlockobtainread.c +++ b/cpukit/score/src/corerwlockobtainread.c @@ -80,7 +80,7 @@ Status_Control _CORE_RWLock_Seize_for_reading( _Thread_queue_Context_set_thread_state( queue_context, - STATES_WAITING_FOR_RWLOCK + STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_RWLOCK ); _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context ); _Thread_queue_Enqueue( diff --git a/cpukit/score/src/corerwlockobtainwrite.c b/cpukit/score/src/corerwlockobtainwrite.c index 7f636daa99..75168fc062 100644 --- a/cpukit/score/src/corerwlockobtainwrite.c +++ b/cpukit/score/src/corerwlockobtainwrite.c @@ -68,7 +68,7 @@ Status_Control _CORE_RWLock_Seize_for_writing( _Thread_queue_Context_set_thread_state( queue_context, - STATES_WAITING_FOR_RWLOCK + STATES_THREAD_QUEUE_WITH_IDENTIFIER | STATES_WAITING_FOR_RWLOCK ); _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context ); _Thread_queue_Enqueue( diff --git a/cpukit/score/src/futex.c b/cpukit/score/src/futex.c index ea4cc89344..d09b00b1c9 100644 --- a/cpukit/score/src/futex.c +++ b/cpukit/score/src/futex.c @@ -94,7 +94,7 @@ int _Futex_Wait( struct _Futex_Control *_futex, int *uaddr, int val ) if ( *uaddr == val ) { _Thread_queue_Context_set_thread_state( &queue_context, - STATES_WAITING_FOR_SYS_LOCK_FUTEX + STATES_WAITING_FOR_FUTEX ); _Thread_queue_Context_set_do_nothing_enqueue_callout( &queue_context ); _Thread_queue_Context_set_no_timeout( &queue_context ); diff --git a/cpukit/score/src/mutex.c b/cpukit/score/src/mutex.c index 30fba4e2fd..ebdedf773d 100644 --- a/cpukit/score/src/mutex.c +++ b/cpukit/score/src/mutex.c @@ -111,7 +111,7 @@ static void _Mutex_Acquire_slow( { _Thread_queue_Context_set_thread_state( queue_context, - STATES_WAITING_FOR_SYS_LOCK_MUTEX + STATES_WAITING_FOR_MUTEX ); _Thread_queue_Context_set_do_nothing_enqueue_callout( queue_context ); _Thread_queue_Context_set_deadlock_callout( diff --git a/cpukit/score/src/semaphore.c b/cpukit/score/src/semaphore.c index 7619147ece..5e64583803 100644 --- a/cpukit/score/src/semaphore.c +++ b/cpukit/score/src/semaphore.c @@ -105,7 +105,7 @@ void _Semaphore_Wait( struct _Semaphore_Control *_sem ) } else { _Thread_queue_Context_set_thread_state( &queue_context, - STATES_WAITING_FOR_SYS_LOCK_SEMAPHORE + STATES_WAITING_FOR_SEMAPHORE ); _Thread_queue_Context_set_do_nothing_enqueue_callout( &queue_context ); _Thread_queue_Context_set_no_timeout( &queue_context ); diff --git a/cpukit/score/src/threadwaitgetid.c b/cpukit/score/src/threadwaitgetid.c index 6c12fd6d3e..9f17250353 100644 --- a/cpukit/score/src/threadwaitgetid.c +++ b/cpukit/score/src/threadwaitgetid.c @@ -18,14 +18,6 @@ #include -#define THREAD_WAIT_QUEUE_OBJECT_STATES \ - ( STATES_WAITING_FOR_BARRIER \ - | STATES_WAITING_FOR_CONDITION_VARIABLE \ - | STATES_WAITING_FOR_MESSAGE \ - | STATES_WAITING_FOR_MUTEX \ - | STATES_WAITING_FOR_RWLOCK \ - | STATES_WAITING_FOR_SEMAPHORE ) - Objects_Id _Thread_Wait_get_id( const Thread_Control *the_thread ) { States_Control current_state; @@ -38,7 +30,7 @@ Objects_Id _Thread_Wait_get_id( const Thread_Control *the_thread ) } #endif - if ( ( current_state & THREAD_WAIT_QUEUE_OBJECT_STATES ) != 0 ) { + if ( ( current_state & STATES_THREAD_QUEUE_WITH_IDENTIFIER ) != 0 ) { const Thread_queue_Object *queue_object; queue_object = THREAD_QUEUE_QUEUE_TO_OBJECT( the_thread->Wait.queue ); -- cgit v1.2.3