diff options
Diffstat (limited to 'cpukit/score/include/rtems/score/threadq.h')
-rw-r--r-- | cpukit/score/include/rtems/score/threadq.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/cpukit/score/include/rtems/score/threadq.h b/cpukit/score/include/rtems/score/threadq.h index 084161cc4d..df03cfb96a 100644 --- a/cpukit/score/include/rtems/score/threadq.h +++ b/cpukit/score/include/rtems/score/threadq.h @@ -45,11 +45,28 @@ struct Scheduler_Node; typedef struct _Thread_Control Thread_Control; +typedef struct Thread_queue_Context Thread_queue_Context; + typedef struct Thread_queue_Queue Thread_queue_Queue; typedef struct Thread_queue_Operations Thread_queue_Operations; /** + * @brief Thread queue enqueue callout. + * + * @param[in] queue The actual thread queue. + * @param[in] the_thread The thread to enqueue. + * @param[in] queue_context The thread queue context of the lock acquire. + * + * @see _Thread_queue_Context_set_enqueue_callout(). + */ +typedef void ( *Thread_queue_Enqueue_callout )( + Thread_queue_Queue *queue, + Thread_Control *the_thread, + Thread_queue_Context *queue_context +); + +/** * @brief Thread queue deadlock callout. * * @param the_thread The thread that detected the deadlock. @@ -168,7 +185,7 @@ typedef struct { * * @see _Thread_queue_Context_initialize(). */ -typedef struct { +struct Thread_queue_Context { /** * @brief The lock context for the thread queue acquire and release * operations. @@ -176,13 +193,14 @@ typedef struct { Thread_queue_Lock_context Lock_context; /** - * @brief The expected thread dispatch disable level for - * _Thread_queue_Enqueue_critical(). + * @brief The enqueue callout for _Thread_queue_Enqueue_critical(). + * + * The callout is invoked after the release of the thread queue lock with + * thread dispatching disabled. Afterwards the thread is blocked. * - * In case the actual thread dispatch disable level is not equal to the - * expected level, then a fatal error occurs. + * @see _Thread_queue_Enqueue_do_nothing(). */ - uint32_t expected_thread_dispatch_disable_level; + Thread_queue_Enqueue_callout enqueue_callout; /** * @brief The clock discipline for the interval timeout. @@ -274,7 +292,7 @@ typedef struct { */ Thread_queue_MP_callout mp_callout; #endif -} Thread_queue_Context; +}; /** * @brief Thread priority queue. |