17 #ifndef _RTEMS_POSIX_CONDIMPL_H 18 #define _RTEMS_POSIX_CONDIMPL_H 33 pthread_mutex_t *
mutex;
36 #define POSIX_CONDITION_VARIABLES_CLOCK_MONOTONIC 0x1UL 38 #define POSIX_CONDITION_VARIABLES_FLAGS_MASK 0x1UL 40 #define POSIX_CONDITION_VARIABLES_MAGIC 0x18dfb1feUL 46 #define POSIX_CONDITION_VARIABLES_NO_MUTEX NULL 48 #define POSIX_CONDITION_VARIABLES_TQ_OPERATIONS &_Thread_queue_Operations_FIFO 50 #define POSIX_CONDITION_VARIABLE_OF_THREAD_QUEUE_QUEUE( queue ) \ 52 queue, POSIX_Condition_variables_Control, Queue.Queue ) 68 const pthread_condattr_t *the_attr
76 flags = (uintptr_t) the_cond ^ POSIX_CONDITION_VARIABLES_MAGIC;
77 flags &= ~POSIX_CONDITION_VARIABLES_FLAGS_MASK;
79 if ( the_attr->clock == CLOCK_MONOTONIC ) {
80 flags |= POSIX_CONDITION_VARIABLES_CLOCK_MONOTONIC;
83 the_cond->flags = flags;
90 the_cond->flags = ~the_cond->flags;
97 if ( ( flags & POSIX_CONDITION_VARIABLES_CLOCK_MONOTONIC ) != 0 ) {
98 return CLOCK_MONOTONIC;
101 return CLOCK_REALTIME;
112 _Thread_queue_Context_ISR_disable( queue_context, level );
114 executing = _Thread_Executing;
115 _Thread_queue_Queue_acquire_critical(
116 &the_cond->Queue.Queue,
117 &executing->Potpourri_stats,
130 &the_cond->Queue.Queue,
142 pthread_cond_t *cond,
153 pthread_cond_t *cond,
154 pthread_mutex_t *
mutex,
155 const struct timespec *abstime
158 bool _POSIX_Condition_variables_Auto_initialization(
162 #define POSIX_CONDITION_VARIABLES_VALIDATE_OBJECT( the_cond, flags ) \ 164 if ( ( the_cond ) == NULL ) { \ 167 flags = ( the_cond )->flags; \ 169 ( ( (uintptr_t) ( the_cond ) ^ POSIX_CONDITION_VARIABLES_MAGIC ) \ 170 & ~POSIX_CONDITION_VARIABLES_FLAGS_MASK ) \ 171 != ( flags & ~POSIX_CONDITION_VARIABLES_FLAGS_MASK ) \ 173 if ( !_POSIX_Condition_variables_Auto_initialization( the_cond ) ) { \ #define POSIX_CONDITION_VARIABLES_NO_MUTEX
Definition: condimpl.h:46
Thread queue context for the thread queue methods.
Definition: threadq.h:198
POSIX Threads Private Support.
const pthread_condattr_t _POSIX_Condition_variables_Default_attributes
Definition: conddefaultattributes.c:29
int _POSIX_Condition_variables_Wait_support(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime)
POSIX condition variables wait support.
Definition: condwaitsupp.c:94
Thread queue with a layout compatible to struct _Thread_queue_Queue defined in Newlib <sys/lock....
Definition: threadqimpl.h:54
int _POSIX_Condition_variables_Signal_support(pthread_cond_t *cond, bool is_broadcast)
Implements wake up version of the "signal" operation.
Definition: condsignalsupp.c:31
uint32_t ISR_Level
Definition: isrlevel.h:41
Thread_queue_Lock_context Lock_context
The lock context for the thread queue acquire and release operations.
Definition: threadq.h:203
Constants and Structures Associated with the Manipulation of Objects.
RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_initialize(Thread_queue_Queue *queue, const char *name)
Initializes the thread queue queue with the given name.
Definition: threadqimpl.h:547
RTEMS_INLINE_ROUTINE void _Thread_queue_Context_set_ISR_level(Thread_queue_Context *queue_context, ISR_Level level)
Sets the thread queue context ISR level.
Definition: threadqimpl.h:411
Definition: condimpl.h:30
ISR_lock_Context Lock_context
The lock context for the thread queue acquire and release operations.
Definition: threadq.h:130
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
RTEMS_INLINE_ROUTINE void _Thread_queue_Queue_release(Thread_queue_Queue *queue, ISR_lock_Context *lock_context)
Releases the thread queue queue and enables interrupts.
Definition: threadqimpl.h:625
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77