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
73 _Thread_queue_Queue_initialize( &the_cond->Queue.Queue,
NULL );
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 );
113 _Thread_queue_Context_set_ISR_level( queue_context, level );
114 executing = _Thread_Executing;
115 _Thread_queue_Queue_acquire_critical(
116 &the_cond->Queue.Queue,
117 &executing->Potpourri_stats,
129 _Thread_queue_Queue_release(
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:193
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
POSIX Threads Private Support.
const pthread_condattr_t _POSIX_Condition_variables_Default_attributes
Definition: conddefaultattributes.c:28
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:93
uint32_t ISR_Level
Definition: isrlevel.h:38
Thread queue with a layout compatible to struct _Thread_queue_Queue defined in Newlib <sys/lock...
Definition: threadqimpl.h:51
int _POSIX_Condition_variables_Signal_support(pthread_cond_t *cond, bool is_broadcast)
Implements wake up version of the "signal" operation.
Definition: condsignalsupp.c:30
Thread_queue_Lock_context Lock_context
The lock context for the thread queue acquire and release operations.
Definition: threadq.h:198
Definition: condimpl.h:30
ISR_lock_Context Lock_context
The lock context for the thread queue acquire and release operations.
Definition: threadq.h:125
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77