diff options
Diffstat (limited to 'cpukit/score/include/rtems/score/threadq.h')
-rw-r--r-- | cpukit/score/include/rtems/score/threadq.h | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/cpukit/score/include/rtems/score/threadq.h b/cpukit/score/include/rtems/score/threadq.h index 06ea36a905..599a81c23c 100644 --- a/cpukit/score/include/rtems/score/threadq.h +++ b/cpukit/score/include/rtems/score/threadq.h @@ -41,64 +41,85 @@ extern "C" { typedef struct Thread_Control Thread_Control; -typedef struct Thread_queue_Control Thread_queue_Control; +typedef struct { + /** This union contains the data structures used to manage the blocked + * set of tasks which varies based upon the discipline. + */ + union { + /** This is the FIFO discipline list. */ + Chain_Control Fifo; + /** This is the set of threads for priority discipline waiting. */ + RBTree_Control Priority; + } Heads; + + /** + * @brief Lock to protect this thread queue. + * + * It may be used to protect additional state of the object embedding this + * thread queue. + * + * @see _Thread_queue_Acquire(), _Thread_queue_Acquire_critical() and + * _Thread_queue_Release(). + */ + ISR_LOCK_MEMBER( Lock ) +} Thread_queue_Queue; /** * @brief Thread queue priority change operation. * * @param[in] the_thread The thread. * @param[in] new_priority The new priority value. - * @param[in] the_thread_queue The thread queue. + * @param[in] queue The actual thread queue. * * @see Thread_queue_Operations. */ typedef void ( *Thread_queue_Priority_change_operation )( - Thread_Control *the_thread, - Priority_Control new_priority, - Thread_queue_Control *the_thread_queue + Thread_Control *the_thread, + Priority_Control new_priority, + Thread_queue_Queue *queue ); /** * @brief Thread queue initialize operation. * - * @param[in] the_thread_queue The thread queue. + * @param[in] queue The actual thread queue. * * @see _Thread_Wait_set_operations(). */ typedef void ( *Thread_queue_Initialize_operation )( - Thread_queue_Control *the_thread_queue + Thread_queue_Queue *queue ); /** * @brief Thread queue enqueue operation. * - * @param[in] the_thread_queue The thread queue. + * @param[in] queue The actual thread queue. * @param[in] the_thread The thread to enqueue on the queue. * * @see _Thread_Wait_set_operations(). */ typedef void ( *Thread_queue_Enqueue_operation )( - Thread_queue_Control *the_thread_queue, - Thread_Control *the_thread + Thread_queue_Queue *queue, + Thread_Control *the_thread ); /** * @brief Thread queue extract operation. * - * @param[in] the_thread_queue The thread queue. + * @param[in] queue The actual thread queue. * @param[in] the_thread The thread to extract from the thread queue. * * @see _Thread_Wait_set_operations(). */ typedef void ( *Thread_queue_Extract_operation )( - Thread_queue_Control *the_thread_queue, - Thread_Control *the_thread + Thread_queue_Queue *queue, + Thread_Control *the_thread ); /** * @brief Thread queue first operation. * - * @param[in] the_thread_queue The thread queue. + * @param[in] queue The actual thread queue. * * @retval NULL No thread is present on the thread queue. * @retval first The first thread of the thread queue according to the insert @@ -107,7 +128,7 @@ typedef void ( *Thread_queue_Extract_operation )( * @see _Thread_Wait_set_operations(). */ typedef Thread_Control *( *Thread_queue_First_operation )( - Thread_queue_Control *the_thread_queue + Thread_queue_Queue *queue ); /** @@ -168,33 +189,17 @@ typedef enum { * This is the structure used to manage sets of tasks which are blocked * waiting to acquire a resource. */ -struct Thread_queue_Control { - /** This union contains the data structures used to manage the blocked - * set of tasks which varies based upon the discipline. - */ - union { - /** This is the FIFO discipline list. */ - Chain_Control Fifo; - /** This is the set of threads for priority discipline waiting. */ - RBTree_Control Priority; - } Queues; - +typedef struct { /** - * @brief The operations for this thread queue. + * @brief The actual thread queue. */ - const Thread_queue_Operations *operations; + Thread_queue_Queue Queue; /** - * @brief Lock to protect this thread queue. - * - * It may be used to protect additional state of the object embedding this - * thread queue. - * - * @see _Thread_queue_Acquire(), _Thread_queue_Acquire_critical() and - * _Thread_queue_Release(). + * @brief The operations for the actual thread queue. */ - ISR_LOCK_MEMBER( Lock ) -}; + const Thread_queue_Operations *operations; +} Thread_queue_Control; /**@}*/ |