19 #ifndef _RTEMS_SCORE_THREADQIMPL_H 20 #define _RTEMS_SCORE_THREADQIMPL_H 50 _Thread_queue_Acquire_critical( the_thread_queue, lock_context );
147 uint32_t timeout_code,
160 uint32_t timeout_code
165 _Thread_queue_Acquire( the_thread_queue, &lock_context );
347 #if defined(RTEMS_SMP) 348 #define THREAD_QUEUE_FIFO_INITIALIZER( designator, name ) { \ 350 .Fifo = CHAIN_INITIALIZER_EMPTY( designator.Queues.Fifo ) \ 352 .operations = &_Thread_queue_Operations_FIFO, \ 353 .Lock = ISR_LOCK_INITIALIZER( name ) \ 356 #define THREAD_QUEUE_PRIORITY_INITIALIZER( designator, name ) { \ 358 .Priority = RBTREE_INITIALIZER_EMPTY( designator.Queues.Priority ) \ 360 .operations = &_Thread_queue_Operations_priority, \ 361 .Lock = ISR_LOCK_INITIALIZER( name ) \ 364 #define THREAD_QUEUE_FIFO_INITIALIZER( designator, name ) { \ 366 .Fifo = CHAIN_INITIALIZER_EMPTY( designator.Queues.Fifo ) \ 368 .operations = &_Thread_queue_Operations_FIFO \ 371 #define THREAD_QUEUE_PRIORITY_INITIALIZER( designator, name ) { \ 373 .Priority = RBTREE_INITIALIZER_EMPTY( designator.Queues.Priority ) \ 375 .operations = &_Thread_queue_Operations_priority \ const Thread_queue_Operations * operations
The operations for this thread queue.
Definition: threadq.h:185
void _Thread_queue_Unblock_critical(Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_lock_Context *lock_context)
Unblocks the thread which was on the thread queue before.
Definition: threadqenqueue.c:116
#define _ISR_lock_Acquire(_lock, _context)
Acquires an ISR lock inside an ISR disabled section.
Definition: isrlock.h:257
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
void _Thread_queue_Extract(Thread_Control *the_thread)
Extracts thread from thread queue.
Definition: threadqenqueue.c:162
Thread_Control * _Thread_queue_Dequeue(Thread_queue_Control *the_thread_queue)
Gets a pointer to a thread waiting on the_thread_queue.
Definition: threadqenqueue.c:181
void _Thread_queue_Extract_locked(Thread_queue_Control *the_thread_queue, Thread_Control *the_thread)
Extracts the thread from the thread queue, restores the default wait operations and restores the defa...
Definition: threadqenqueue.c:104
This is the structure used to manage sets of tasks which are blocked waiting to acquire a resource...
Definition: threadq.h:171
RTEMS_INLINE_ROUTINE void _Thread_queue_Enqueue(Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, States_Control state, Watchdog_Interval timeout, uint32_t timeout_code)
Acquires the thread queue lock and calls _Thread_queue_Enqueue_critical().
Definition: threadqimpl.h:155
void _Thread_queue_Flush(Thread_queue_Control *the_thread_queue, Thread_queue_Flush_callout remote_extract_callout, uint32_t status)
Unblocks all threads blocked on the_thread_queue.
Definition: threadqflush.c:24
Thread_queue_First_operation first
Thread queue first operation.
Definition: threadq.h:155
Constants and Structures Needed to Declare a Thread Queue.
long RBTree_Compare_result
Integer type for compare results.
Definition: rbtree.h:99
Thread queue operations.
Definition: threadq.h:118
Constants and Structures Related with the Thread Control Block.
void _Thread_queue_Enqueue_critical(Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, States_Control state, Watchdog_Interval timeout, uint32_t timeout_code, ISR_lock_Context *lock_context)
Blocks the thread and places it on the thread queue.
Definition: threadqenqueue.c:48
void _Thread_queue_Extract_critical(Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_lock_Context *lock_context)
Extracts the thread from the thread queue and unblocks it.
Definition: threadqenqueue.c:152
RBTree_Compare_result _Thread_queue_Compare_priority(const RBTree_Node *left, const RBTree_Node *right)
Compare two thread's priority for RBTree Insertion.
Definition: threadq.c:25
#define _ISR_lock_ISR_disable(_context)
Disables interrupts and saves the previous interrupt state in the ISR lock context.
Definition: isrlock.h:337
This structure defines the Thread Control Block (TCB).
Definition: thread.h:671
#define _ISR_lock_Release_and_ISR_enable(_lock, _context)
Releases an ISR lock.
Definition: isrlock.h:230
Inlined Routines Associated with Red-Black Trees.
void _Thread_queue_Initialize(Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline)
Initialize the_thread_queue.
Definition: threadq.c:46
uint32_t States_Control
The following type defines the control block used to manage a thread's state.
Definition: states.h:41
uint32_t Watchdog_Interval
Type is used to specify the length of intervals.
Definition: watchdog.h:47
Thread_Control * _Thread_queue_First(Thread_queue_Control *the_thread_queue)
Returns the first thread on the thread queue if it exists, otherwise NULL.
Definition: threadqfirst.c:23
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
RTEMS_INLINE_ROUTINE Thread_Control * _Thread_queue_First_locked(Thread_queue_Control *the_thread_queue)
Returns the first thread on the thread queue if it exists, otherwise NULL.
Definition: threadqimpl.h:293
void _Thread_queue_Extract_with_proxy(Thread_Control *the_thread)
Extracts the_thread from the_thread_queue.
Definition: threadqextractwithproxy.c:31
This is used to manage each element (node) which is placed on a RBT.
Definition: rbtree.h:75
#define _ISR_lock_Destroy(_lock)
Destroys an ISR lock.
Definition: isrlock.h:181
Thread_queue_Disciplines
The following enumerated type details all of the disciplines supported by the Thread Queue Handler...
Definition: threadq.h:162
void(* Thread_queue_Flush_callout)(Thread_Control *)
The following type defines the callout used when a remote task is extracted from a local thread queue...
Definition: threadqimpl.h:65