28 #
if defined(RTEMS_SMP)
33 == offsetof(
struct _Thread_queue_Queue, _Lock._next_ticket ),
34 THREAD_QUEUE_SYSLOCK_QUEUE_NEXT_TICKET
38 #
if defined(RTEMS_SMP)
43 == offsetof(
struct _Thread_queue_Queue, _Lock._now_serving ),
44 THREAD_QUEUE_SYSLOCK_QUEUE_NOW_SERVING
49 == offsetof(
struct _Thread_queue_Queue, _heads ),
50 THREAD_QUEUE_SYSLOCK_QUEUE_HEADS
55 == offsetof(
struct _Thread_queue_Queue, _owner ),
56 THREAD_QUEUE_SYSLOCK_QUEUE_OWNER
61 == offsetof(
struct _Thread_queue_Queue, _name ),
62 THREAD_QUEUE_SYSLOCK_QUEUE_NAME
67 ==
sizeof(
struct _Thread_queue_Queue ),
68 THREAD_QUEUE_SYSLOCK_QUEUE_SIZE
71 #if defined(RTEMS_SMP) 77 _Thread_queue_Queue_acquire_critical(
78 &the_thread_queue->
Queue,
79 &the_thread_queue->Lock_stats,
82 #if defined(RTEMS_DEBUG) 83 the_thread_queue->owner = _SMP_lock_Who_am_I();
93 _Thread_queue_Queue_acquire_critical(
94 &the_thread_queue->
Queue,
95 &the_thread_queue->Lock_stats,
98 #if defined(RTEMS_DEBUG) 99 the_thread_queue->owner = _SMP_lock_Who_am_I();
108 #if defined(RTEMS_DEBUG) 109 _Assert( _Thread_queue_Is_lock_owner( the_thread_queue ) );
110 the_thread_queue->owner = SMP_LOCK_NO_OWNER;
113 &the_thread_queue->
Queue,
123 #if defined(RTEMS_DEBUG) 124 _Assert( _Thread_queue_Is_lock_owner( the_thread_queue ) );
125 the_thread_queue->owner = SMP_LOCK_NO_OWNER;
128 &the_thread_queue->
Queue,
143 #if defined(RTEMS_SMP) 144 _SMP_lock_Stats_initialize( &the_thread_queue->Lock_stats,
"Thread Queue" );
153 #if defined(RTEMS_MULTIPROCESSING) 154 void _Thread_queue_MP_callout_do_nothing(
177 queue_object = THREAD_QUEUE_QUEUE_TO_OBJECT( queue );
178 *
id = queue_object->Object.
id;
180 queue_object->Object.
name,
186 if ( name == NULL ) {
191 return strlcpy( buffer, name, buffer_size );
void _Thread_queue_Initialize(Thread_queue_Control *the_thread_queue, const char *name)
Initializes the thread queue control to the given name.
Thread queue context for the thread queue methods.
void _Thread_queue_Acquire(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Acquires the thread queue control in a critical section.
size_t _Objects_Name_to_string(Objects_Name name, bool is_string, char *buffer, size_t buffer_size)
Converts the specified object name to a text representation.
static __inline__ void _Thread_queue_Queue_initialize(Thread_queue_Queue *queue, const char *name)
Initializes the thread queue queue with the given name.
#define _ISR_lock_ISR_enable(_context)
Restores the saved interrupt state of the ISR lock context.
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.
void _Thread_queue_Object_initialize(Thread_queue_Control *the_thread_queue)
Initializes a thread queue embedded in an object with identifier.
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.
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.
Thread_queue_Queue Queue
The actual thread queue.
Thread queue with a layout compatible to struct _Thread_queue_Queue defined in Newlib <sys/lock...
const char * name
The thread queue name.
Thread_queue_Lock_context Lock_context
The lock context for the thread queue acquire and release operations.
Constants and Structures Associated with the Manipulation of Objects.
#define RTEMS_STATIC_ASSERT(_cond, _msg)
Asserts at compile time that the specified condition is satisfied.
Inlined Routines Associated with Red-Black Trees.
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.
const char _Thread_queue_Object_name[]
The special thread queue name to indicated that the thread queue is embedded in an object with identi...
#define _ISR_lock_ISR_disable(_context)
Disables interrupts and saves the previous interrupt state in the ISR lock context.
Inlined Routines from the Thread Handler.
Local ISR lock context for acquire and release pairs.
ISR_lock_Context Lock_context
The lock context for the thread queue acquire and release operations.
void _Thread_queue_Release(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Releases the thread queue control and enables interrupts.
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.
Helper structure to ensure that all objects containing a thread queue have the right layout...