From 22788bc2baeb8e13bb0d6b6d05782a6ccfd4cb67 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 23 Apr 2015 13:01:05 +0200 Subject: score: _Thread_queue_Extract() Remove thread queue parameter from _Thread_queue_Extract() since the current thread queue is stored in the thread control block. --- cpukit/score/include/rtems/score/threadqimpl.h | 16 +++++----------- cpukit/score/src/corerwlockrelease.c | 2 +- cpukit/score/src/mpci.c | 2 +- cpukit/score/src/threadqenqueue.c | 14 ++++++-------- cpukit/score/src/threadqextractwithproxy.c | 7 +------ cpukit/score/src/threadqprocesstimeout.c | 1 - 6 files changed, 14 insertions(+), 28 deletions(-) (limited to 'cpukit/score') diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h index 6eac3643f4..6fc38cfa5b 100644 --- a/cpukit/score/include/rtems/score/threadqimpl.h +++ b/cpukit/score/include/rtems/score/threadqimpl.h @@ -78,25 +78,20 @@ void _Thread_queue_Enqueue( /** * @brief Extracts thread from thread queue. * - * This routine removes @a the_thread from @a the_thread_queue + * This routine removes @a the_thread its thread queue * and cancels any timeouts associated with this blocking. * - * @param[in] the_thread_queue is the pointer to the ThreadQ header * @param[in] the_thread is the pointer to a thread control block that * is to be removed */ -void _Thread_queue_Extract( - Thread_queue_Control *the_thread_queue, - Thread_Control *the_thread -); +void _Thread_queue_Extract( Thread_Control *the_thread ); /** * @brief Extracts thread from thread queue (w/return code). * - * This routine removes @a the_thread from @a the_thread_queue + * This routine removes @a the_thread its thread queue * and cancels any timeouts associated with this blocking. * - * @param[in] the_thread_queue is the pointer to the ThreadQ header * @param[in] the_thread is the pointer to a thread control block that * is to be removed * @param[in] return_code specifies the status to be returned. @@ -105,9 +100,8 @@ void _Thread_queue_Extract( * + single case */ void _Thread_queue_Extract_with_return_code( - Thread_queue_Control *the_thread_queue, - Thread_Control *the_thread, - uint32_t return_code + Thread_Control *the_thread, + uint32_t return_code ); /** diff --git a/cpukit/score/src/corerwlockrelease.c b/cpukit/score/src/corerwlockrelease.c index efaf67d351..bd39213c87 100644 --- a/cpukit/score/src/corerwlockrelease.c +++ b/cpukit/score/src/corerwlockrelease.c @@ -87,7 +87,7 @@ CORE_RWLock_Status _CORE_RWLock_Release( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; - _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); + _Thread_queue_Extract( next ); } } diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c index 9b623b253f..424bcb4d33 100644 --- a/cpukit/score/src/mpci.c +++ b/cpukit/score/src/mpci.c @@ -262,7 +262,7 @@ Thread_Control *_MPCI_Process_response ( the_thread = NULL; /* IMPOSSIBLE */ break; case OBJECTS_LOCAL: - _Thread_queue_Extract( &_MPCI_Remote_blocked_threads, the_thread ); + _Thread_queue_Extract( the_thread ); the_thread->Wait.return_code = the_packet->return_code; _Objects_Put_without_thread_dispatch( &the_thread->Object ); break; diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c index 5c237560f4..0e16f59c46 100644 --- a/cpukit/score/src/threadqenqueue.c +++ b/cpukit/score/src/threadqenqueue.c @@ -185,11 +185,11 @@ void _Thread_queue_Enqueue( } void _Thread_queue_Extract_with_return_code( - Thread_queue_Control *the_thread_queue, - Thread_Control *the_thread, - uint32_t return_code + Thread_Control *the_thread, + uint32_t return_code ) { + Thread_queue_Control *the_thread_queue; ISR_lock_Context lock_context; _Thread_queue_Acquire( &lock_context ); @@ -199,6 +199,8 @@ void _Thread_queue_Extract_with_return_code( 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 */ @@ -220,13 +222,9 @@ void _Thread_queue_Extract_with_return_code( _Thread_blocking_operation_Finalize( the_thread, &lock_context ); } -void _Thread_queue_Extract( - Thread_queue_Control *the_thread_queue, - Thread_Control *the_thread -) +void _Thread_queue_Extract( Thread_Control *the_thread ) { _Thread_queue_Extract_with_return_code( - the_thread_queue, the_thread, the_thread->Wait.return_code ); diff --git a/cpukit/score/src/threadqextractwithproxy.c b/cpukit/score/src/threadqextractwithproxy.c index fb06526e9e..72043a094d 100644 --- a/cpukit/score/src/threadqextractwithproxy.c +++ b/cpukit/score/src/threadqextractwithproxy.c @@ -31,8 +31,6 @@ void _Thread_queue_Extract_with_proxy( Thread_Control *the_thread ) { - Thread_queue_Control *the_thread_queue; - #if defined(RTEMS_MULTIPROCESSING) States_Control state; @@ -50,8 +48,5 @@ void _Thread_queue_Extract_with_proxy( } #endif - the_thread_queue = the_thread->Wait.queue; - if ( the_thread_queue != NULL ) { - _Thread_queue_Extract( the_thread_queue, the_thread ); - } + _Thread_queue_Extract( the_thread ); } diff --git a/cpukit/score/src/threadqprocesstimeout.c b/cpukit/score/src/threadqprocesstimeout.c index 616901900d..dbb8f5ce45 100644 --- a/cpukit/score/src/threadqprocesstimeout.c +++ b/cpukit/score/src/threadqprocesstimeout.c @@ -69,7 +69,6 @@ void _Thread_queue_Process_timeout( * queue initialization. */ _Thread_queue_Extract_with_return_code( - the_thread_queue, the_thread, the_thread_queue->timeout_status ); -- cgit v1.2.3