diff options
Diffstat (limited to 'cpukit/score/include/rtems/score/threadqimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/threadqimpl.h | 157 |
1 files changed, 24 insertions, 133 deletions
diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h index 0acc66ee6c..0e139cdbc6 100644 --- a/cpukit/score/include/rtems/score/threadqimpl.h +++ b/cpukit/score/include/rtems/score/threadqimpl.h @@ -60,6 +60,9 @@ typedef void ( *Thread_queue_Timeout_callout )( * the_thread_queue. The selection of this thread is based on * the discipline of the_thread_queue. If no threads are waiting * on the_thread_queue, then NULL is returned. + * + * - INTERRUPT LATENCY: + * + single case */ Thread_Control *_Thread_queue_Dequeue( Thread_queue_Control *the_thread_queue @@ -123,6 +126,9 @@ void _Thread_queue_Extract( * @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. + * + * - INTERRUPT LATENCY: + * + single case */ void _Thread_queue_Extract_with_return_code( Thread_queue_Control *the_thread_queue, @@ -213,138 +219,6 @@ Thread_Control *_Thread_queue_Dequeue_priority( ); /** - * @brief Enqueues the currently executing thread on the_thread_queue. - * - * This routine enqueues the currently executing thread on - * the_thread_queue with an optional timeout using the - * priority discipline. - * - * @param[in] the_thread_queue is the pointer to threadq - * @param[in] the_thread is the thread to insert - * @param[in] level_p is a pointer to an interrupt level to be returned - * - * @retval This methods returns an indication of the blocking state as - * well as filling in *@ level_p with the previous interrupt level. - * - * - INTERRUPT LATENCY: - * + single case - */ -Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( - Thread_queue_Control *the_thread_queue, - Thread_Control *the_thread, - ISR_Level *level_p -); - -/** - * @brief Removes the_thread and cancels related timeouts. - * - * This routine removes the_thread from the_thread_queue - * and cancels any timeouts associated with this blocking. - * @param[in] the_thread_queue pointer to a threadq header - * @param[in] the_thread pointer to a thread control block - * @param[in] requeuing true if requeuing and should not alter - * timeout or state - * - * - INTERRUPT LATENCY: - * + single case - * - * @retval true The extract operation was performed by the executing context. - * @retval false Otherwise. - */ -void _Thread_queue_Extract_priority_helper( - Thread_Control *the_thread, - uint32_t return_code, - bool requeuing -); - -/** - * @brief Wraps the underlying call and hides the requeuing argument. - * - * This macro wraps the underlying call and hides the requeuing argument. - */ -#define _Thread_queue_Extract_priority( _the_thread, _return_code ) \ - _Thread_queue_Extract_priority_helper( _the_thread, _return_code, false ) - -/** - * @brief Get highest priority thread on the_thread_queue. - * - * This function returns a pointer to the "first" thread - * on @a the_thread_queue. The "first" thread is the highest - * priority thread waiting on @a the_thread_queue. - * - * @param[in] the_thread_queue is the pointer to the thread queue - * @retval first thread or NULL - */ -Thread_Control *_Thread_queue_First_priority( - Thread_queue_Control *the_thread_queue -); - -/** - * @brief Gets a pointer to the thread which has been waiting the longest. - * - * This function returns a pointer to the thread which has - * been waiting the longest on the_thread_queue. If no - * threads are waiting on the_thread_queue, then NULL is returned. - * - * @param[in] the_thread_queue is the pointer to threadq - * - * @retval thread dequeued or NULL - * - * - INTERRUPT LATENCY: - * + check sync - * + FIFO - */ -Thread_Control *_Thread_queue_Dequeue_fifo( - Thread_queue_Control *the_thread_queue -); - -/** - * @brief Enqueues the currently executing thread on the_thread_queue. - * - * This routine enqueues the currently executing thread on - * the_thread_queue with an optional timeout using the - * FIFO discipline. - * - * @param[in] the_thread_queue pointer to threadq - * @param[in] the_thread pointer to the thread to block - * @param[in] level_p interrupt level in case the operation blocks actually - * - * - INTERRUPT LATENCY: - * + single case - */ -Thread_blocking_operation_States _Thread_queue_Enqueue_fifo ( - Thread_queue_Control *the_thread_queue, - Thread_Control *the_thread, - ISR_Level *level_p -); - -/** - * @brief Removes the_thread from the_thread_queue and cancels any timeouts. - * - * This routine removes the_thread from the_thread_queue - * and cancels any timeouts associated with this blocking. - */ -void _Thread_queue_Extract_fifo( - Thread_Control *the_thread, - uint32_t return_code -); - -/** - * @brief Gets a pointer to the "first" thread on the_thread_queue. - * - * This function returns a pointer to the "first" thread - * on the_thread_queue. The first thread is the thread - * which has been waiting longest on the_thread_queue. - * - * @param[in] the_thread_queue is the pointer to threadq - * - * @retval first thread or NULL - */ -Thread_Control *_Thread_queue_First_fifo( - Thread_queue_Control *the_thread_queue -); - -/** * @brief Thread queue timeout. * * This routine is invoked when a task's request has not @@ -355,7 +229,7 @@ Thread_Control *_Thread_queue_First_fifo( * * @param[in] id thread id */ -void _Thread_queue_Timeout ( +void _Thread_queue_Timeout( Objects_Id id, void *ignored ); @@ -392,6 +266,23 @@ int _Thread_queue_Compare_priority( ); /** + * @brief Invoked when a thread changes priority and is blocked. + * + * This routine is invoked when a thread changes priority and is + * blocked on a thread queue. If the queue is priority ordered, + * the_thread is removed from the_thread_queue and reinserted using + * its new priority. This method has no impact on the state of the_thread + * or of any timeouts associated with this blocking. + * + * @param[in] the_thread_queue pointer to a threadq header + * @param[in] the_thread pointer to a thread control block + */ +void _Thread_queue_Requeue( + Thread_queue_Control *the_thread_queue, + Thread_Control *the_thread +); + +/** * This routine is invoked to indicate that the specified thread queue is * entering a critical section. */ |