From 56729d83c99ee393c707acfcbcd7d290f97fd07d Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 23 Apr 2015 21:29:56 +0200 Subject: score: Delete STATES_WAITING_ON_THREAD_QUEUE Avoid the usage of the current thread state in _Thread_queue_Extract_with_return_code() since thread queues should not know anything about thread states. --- cpukit/score/include/rtems/score/statesimpl.h | 26 ++------------------------ cpukit/score/src/threadqenqueue.c | 5 ++--- 2 files changed, 4 insertions(+), 27 deletions(-) (limited to 'cpukit/score') diff --git a/cpukit/score/include/rtems/score/statesimpl.h b/cpukit/score/include/rtems/score/statesimpl.h index 9f94675c89..d1c402e643 100644 --- a/cpukit/score/include/rtems/score/statesimpl.h +++ b/cpukit/score/include/rtems/score/statesimpl.h @@ -105,19 +105,14 @@ extern "C" { STATES_WAITING_FOR_BSD_WAKEUP | \ STATES_WAITING_FOR_RWLOCK ) -/** This macro corresponds to a task waiting which is blocked on - * a thread queue. */ -#define STATES_WAITING_ON_THREAD_QUEUE \ - ( STATES_LOCALLY_BLOCKED | \ - STATES_WAITING_FOR_RPC_REPLY ) - /** This macro corresponds to a task waiting which is blocked. */ #define STATES_BLOCKED ( STATES_DELAYING | \ + STATES_LOCALLY_BLOCKED | \ STATES_WAITING_FOR_TIME | \ STATES_WAITING_FOR_PERIOD | \ STATES_WAITING_FOR_EVENT | \ + STATES_WAITING_FOR_RPC_REPLY | \ STATES_WAITING_FOR_SYSTEM_EVENT | \ - STATES_WAITING_ON_THREAD_QUEUE | \ STATES_INTERRUPTIBLE_BY_SIGNAL ) /** All state bits set to one (provided for _Thread_Ready()) */ @@ -414,23 +409,6 @@ RTEMS_INLINE_ROUTINE bool _States_Is_locally_blocked ( return (the_states & STATES_LOCALLY_BLOCKED); } -/** - * This function returns true if one of the states which indicates - * that a task is blocked waiting for a local resource is set in - * the_states, and false otherwise. - * - * @param[in] the_states is the task state set to test - * - * @return This method returns true if the state indicates that the - * assocated thread is waiting on a thread queue. - */ -RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( - States_Control the_states -) -{ - return (the_states & STATES_WAITING_ON_THREAD_QUEUE); -} - /** * This function returns true if one of the states which indicates * that a task is blocked is set in the_states, and false otherwise. diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c index 0e16f59c46..5f94ec99c9 100644 --- a/cpukit/score/src/threadqenqueue.c +++ b/cpukit/score/src/threadqenqueue.c @@ -194,13 +194,12 @@ void _Thread_queue_Extract_with_return_code( _Thread_queue_Acquire( &lock_context ); - if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { + the_thread_queue = the_thread->Wait.queue; + if ( the_thread_queue == NULL ) { _Thread_queue_Release( &lock_context ); return; } - the_thread_queue = the_thread->Wait.queue; - if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_FIFO ) { _Chain_Extract_unprotected( &the_thread->Object.Node ); } else { /* must be THREAD_QUEUE_DISCIPLINE_PRIORITY */ -- cgit v1.2.3