RTEMS
Classes | Macros | Typedefs | Functions | Variables
threadqimpl.h File Reference

Constants and Structures Associated with the Manipulation of Objects. More...

#include <rtems/score/threadq.h>
#include <rtems/score/chainimpl.h>
#include <rtems/score/priorityimpl.h>
#include <rtems/score/scheduler.h>
#include <rtems/score/smp.h>
#include <rtems/score/status.h>
#include <rtems/score/thread.h>
#include <rtems/score/threaddispatch.h>

Go to the source code of this file.

Classes

struct  Thread_queue_Syslock_queue
 Thread queue with a layout compatible to struct _Thread_queue_Queue defined in Newlib <sys/lock.h>. More...
 
struct  Thread_queue_Object
 Helper structure to ensure that all objects containing a thread queue have the right layout. More...
 

Macros

#define THREAD_QUEUE_LINK_OF_PATH_NODE(node)   RTEMS_CONTAINER_OF( node, Thread_queue_Link, Path_node );
 
#define _Thread_queue_Context_ISR_disable(queue_context, level)
 
#define _Thread_queue_Context_set_MP_callout(queue_context, mp_callout)
 Sets the MP callout in the thread queue context. More...
 
#define _Thread_queue_Queue_acquire_critical(queue, lock_stats, lock_context)   _Thread_queue_Queue_do_acquire_critical( queue, lock_context )
 
#define _Thread_queue_Dequeue(the_thread_queue, operations, mp_callout)
 Gets a pointer to a thread waiting on the_thread_queue. More...
 
#define THREAD_QUEUE_INITIALIZER(_name)
 
#define THREAD_QUEUE_OBJECT_ASSERT(object_type, wait_queue_member, msg)
 
#define THREAD_QUEUE_QUEUE_TO_OBJECT(queue)
 

Typedefs

typedef Thread_Control *(* Thread_queue_Flush_filter) (Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
 Thread queue flush filter function. More...
 

Functions

void _Thread_queue_Enqueue_do_nothing_extra (Thread_queue_Queue *queue, Thread_Control *the_thread, Per_CPU_Control *cpu_self, Thread_queue_Context *queue_context)
 Does nothing. More...
 
void _Thread_queue_Add_timeout_ticks (Thread_queue_Queue *queue, Thread_Control *the_thread, Per_CPU_Control *cpu_self, Thread_queue_Context *queue_context)
 Adds timeout ticks of the queue to the thread. More...
 
void _Thread_queue_Add_timeout_monotonic_timespec (Thread_queue_Queue *queue, Thread_Control *the_thread, Per_CPU_Control *cpu_self, Thread_queue_Context *queue_context)
 Adds a monotonic timespec to the thread and sets the watchdog header to monotonic. More...
 
void _Thread_queue_Add_timeout_realtime_timespec (Thread_queue_Queue *queue, Thread_Control *the_thread, Per_CPU_Control *cpu_self, Thread_queue_Context *queue_context)
 Adds a monotonic timespec to the thread and sets the watchdog header to realtime. More...
 
void _Thread_queue_Deadlock_status (Thread_Control *the_thread)
 Sets the thread wait return code to STATUS_DEADLOCK. More...
 
void _Thread_queue_Deadlock_fatal (Thread_Control *the_thread)
 Results in an INTERNAL_ERROR_THREAD_QUEUE_DEADLOCK fatal error. More...
 
static __inline__ void _Thread_queue_Context_initialize (Thread_queue_Context *queue_context)
 Initializes a thread queue context. More...
 
static __inline__ void _Thread_queue_Context_set_thread_state (Thread_queue_Context *queue_context, States_Control thread_state)
 Sets the thread state for the thread to enqueue in the thread queue context. More...
 
static __inline__ void _Thread_queue_Context_set_timeout_ticks (Thread_queue_Context *queue_context, Watchdog_Interval ticks)
 Sets the timeout ticks in the thread queue context. More...
 
static __inline__ void _Thread_queue_Context_set_timeout_argument (Thread_queue_Context *queue_context, const void *arg)
 Sets the timeout argument in the thread queue context. More...
 
static __inline__ void _Thread_queue_Context_set_enqueue_callout (Thread_queue_Context *queue_context, Thread_queue_Enqueue_callout enqueue_callout)
 Sets the enqueue callout in the thread queue context. More...
 
static __inline__ void _Thread_queue_Context_set_enqueue_do_nothing_extra (Thread_queue_Context *queue_context)
 Sets the do nothing enqueue callout in the thread queue context. More...
 
static __inline__ void _Thread_queue_Context_set_enqueue_timeout_ticks (Thread_queue_Context *queue_context, Watchdog_Interval ticks)
 Sets the enqueue callout to add a relative monotonic timeout in ticks. More...
 
static __inline__ void _Thread_queue_Context_set_enqueue_timeout_monotonic_timespec (Thread_queue_Context *queue_context, const struct timespec *abstime)
 Sets the enqueue callout to add an absolute monotonic timeout in timespec format. More...
 
static __inline__ void _Thread_queue_Context_set_enqueue_timeout_realtime_timespec (Thread_queue_Context *queue_context, const struct timespec *abstime)
 Sets the enqueue callout to add an absolute realtime timeout in timespec format. More...
 
static __inline__ void _Thread_queue_Context_set_deadlock_callout (Thread_queue_Context *queue_context, Thread_queue_Deadlock_callout deadlock_callout)
 Sets the deadlock callout in the thread queue context. More...
 
static __inline__ void _Thread_queue_Context_clear_priority_updates (Thread_queue_Context *queue_context)
 Clears the priority update count of the thread queue context. More...
 
static __inline__ size_t _Thread_queue_Context_save_priority_updates (Thread_queue_Context *queue_context)
 Returns the priority update count of the thread queue context. More...
 
static __inline__ void _Thread_queue_Context_restore_priority_updates (Thread_queue_Context *queue_context, size_t update_count)
 Sets the priority update count of the thread queue context. More...
 
static __inline__ void _Thread_queue_Context_add_priority_update (Thread_queue_Context *queue_context, Thread_Control *the_thread)
 Adds a priority update of the thread to the thread queue context. More...
 
static __inline__ void _Thread_queue_Context_set_ISR_level (Thread_queue_Context *queue_context, ISR_Level level)
 Sets the thread queue context ISR level. More...
 
static __inline__ Per_CPU_Control_Thread_queue_Dispatch_disable (Thread_queue_Context *queue_context)
 Disables dispatching in a critical section. More...
 
static __inline__ void _Thread_queue_Gate_close (Thread_queue_Gate *gate)
 Closes the gate. More...
 
static __inline__ void _Thread_queue_Gate_add (Chain_Control *chain, Thread_queue_Gate *gate)
 Adds the gate to the chain. More...
 
static __inline__ void _Thread_queue_Gate_open (Thread_queue_Gate *gate)
 Opens the gate. More...
 
static __inline__ void _Thread_queue_Gate_wait (Thread_queue_Gate *gate)
 Waits on a gate to open. More...
 
static __inline__ void _Thread_queue_Heads_initialize (Thread_queue_Heads *heads)
 Initializes the thread queue heads. More...
 
static __inline__ void _Thread_queue_Queue_initialize (Thread_queue_Queue *queue, const char *name)
 Initializes the thread queue queue with the given name. More...
 
static __inline__ void _Thread_queue_Queue_do_acquire_critical (Thread_queue_Queue *queue, ISR_lock_Context *lock_context)
 Acquires the thread queue queue in a critical section. More...
 
static __inline__ void _Thread_queue_Queue_release_critical (Thread_queue_Queue *queue, ISR_lock_Context *lock_context)
 Releases the thread queue queue in a critical section. More...
 
static __inline__ void _Thread_queue_Queue_release (Thread_queue_Queue *queue, ISR_lock_Context *lock_context)
 Releases the thread queue queue and enables interrupts. More...
 
size_t _Thread_queue_Queue_get_name_and_id (const Thread_queue_Queue *queue, char *buffer, size_t buffer_size, Objects_Id *id)
 Copies the thread queue name to the specified buffer. More...
 
void _Thread_queue_Do_acquire_critical (Thread_queue_Control *the_thread_queue, ISR_lock_Context *lock_context)
 Acquires the thread queue control in a critical section. More...
 
static __inline__ void _Thread_queue_Acquire_critical (Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
 Acquires the thread queue control in a critical section. More...
 
void _Thread_queue_Acquire (Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
 Acquires the thread queue control in a critical section. More...
 
void _Thread_queue_Do_release_critical (Thread_queue_Control *the_thread_queue, ISR_lock_Context *lock_context)
 Checks if the thread queue control is the owner of the lock. More...
 
static __inline__ void _Thread_queue_Release_critical (Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
 Releases the thread queue control in a critical section. More...
 
void _Thread_queue_Release (Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
 Releases the thread queue control and enables interrupts. More...
 
Thread_Control_Thread_queue_Do_dequeue (Thread_queue_Control *the_thread_queue, const Thread_queue_Operations *operations)
 Dequeues the first thread waiting on the thread queue and returns it. More...
 
void _Thread_queue_Enqueue (Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_Control *the_thread, Thread_queue_Context *queue_context)
 Blocks the thread and places it on the thread queue. More...
 
Status_Control _Thread_queue_Enqueue_sticky (Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_Control *the_thread, Thread_queue_Context *queue_context)
 Enqueues the thread on the thread queue and busy waits for dequeue. More...
 
bool _Thread_queue_Extract_locked (Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_Control *the_thread, Thread_queue_Context *queue_context)
 Extracts the thread from the thread queue, restores the default wait operations and restores the default thread lock. More...
 
void _Thread_queue_Unblock_critical (bool unblock, Thread_queue_Queue *queue, Thread_Control *the_thread, ISR_lock_Context *lock_context)
 Unblocks the thread which was on the thread queue before. More...
 
void _Thread_queue_Extract_critical (Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_Control *the_thread, Thread_queue_Context *queue_context)
 Extracts the thread from the thread queue and unblocks it. More...
 
void _Thread_queue_Extract (Thread_Control *the_thread)
 Extracts thread from thread queue. More...
 
void _Thread_queue_Extract_with_proxy (Thread_Control *the_thread)
 Extracts the_thread from the_thread_queue. More...
 
void _Thread_queue_Surrender (Thread_queue_Queue *queue, Thread_queue_Heads *heads, Thread_Control *previous_owner, Thread_queue_Context *queue_context, const Thread_queue_Operations *operations)
 Surrenders the thread queue previously owned by the thread to the first enqueued thread. More...
 
void _Thread_queue_Surrender_sticky (Thread_queue_Queue *queue, Thread_queue_Heads *heads, Thread_Control *previous_owner, Thread_queue_Context *queue_context, const Thread_queue_Operations *operations)
 Surrenders the thread queue previously owned by the thread to the first enqueued thread. More...
 
static __inline__ bool _Thread_queue_Is_empty (const Thread_queue_Queue *queue)
 Checks if the thread queue queue is empty. More...
 
static __inline__ Thread_Control_Thread_queue_First_locked (Thread_queue_Control *the_thread_queue, const Thread_queue_Operations *operations)
 Returns the first thread on the thread queue if it exists, otherwise NULL. More...
 
Thread_Control_Thread_queue_First (Thread_queue_Control *the_thread_queue, const Thread_queue_Operations *operations)
 Returns the first thread on the thread queue if it exists, otherwise NULL. More...
 
Thread_Control_Thread_queue_Flush_default_filter (Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
 Default thread queue flush filter function. More...
 
Thread_Control_Thread_queue_Flush_status_unavailable (Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
 Status unavailable thread queue flush filter function. More...
 
Thread_Control_Thread_queue_Flush_status_object_was_deleted (Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
 Status object was deleted thread queue flush filter function. More...
 
size_t _Thread_queue_Flush_critical (Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_queue_Flush_filter filter, Thread_queue_Context *queue_context)
 Unblocks all threads enqueued on the thread queue. More...
 
void _Thread_queue_Initialize (Thread_queue_Control *the_thread_queue, const char *name)
 Initializes the thread queue control to the given name. More...
 
static __inline__ void _Thread_queue_Destroy (Thread_queue_Control *the_thread_queue)
 Destroys the thread queue. More...
 
bool _Thread_queue_Path_acquire_critical (Thread_queue_Queue *queue, Thread_Control *the_thread, Thread_queue_Context *queue_context)
 Does nothing. More...
 
void _Thread_queue_Path_release_critical (Thread_queue_Context *queue_context)
 Releases the thread queue path in a critical section. More...
 
void _Thread_queue_Object_initialize (Thread_queue_Control *the_thread_queue)
 Initializes a thread queue embedded in an object with identifier. More...
 

Variables

const Thread_queue_Operations _Thread_queue_Operations_default
 
const Thread_queue_Operations _Thread_queue_Operations_FIFO
 
const Thread_queue_Operations _Thread_queue_Operations_priority
 
const Thread_queue_Operations _Thread_queue_Operations_priority_inherit
 
const char _Thread_queue_Object_name []
 The special thread queue name to indicated that the thread queue is embedded in an object with identifier. More...
 

Detailed Description

Constants and Structures Associated with the Manipulation of Objects.

This include file contains all the constants and structures associated with the manipulation of objects.

Definition in file threadqimpl.h.