25 THREAD_QUEUE_OBJECT_ASSERT(
28 SEMAPHORE_CONTROL_GENERIC
31 THREAD_QUEUE_OBJECT_ASSERT(
34 SEMAPHORE_CONTROL_MUTEX
37 THREAD_QUEUE_OBJECT_ASSERT(
40 SEMAPHORE_CONTROL_SEMAPHORE
43 #if defined(RTEMS_SMP) 44 THREAD_QUEUE_OBJECT_ASSERT(
47 SEMAPHORE_CONTROL_MRSP
63 Status_Control status;
65 the_semaphore = _Semaphore_Get(
id, &queue_context );
67 if ( the_semaphore == NULL ) {
68 #if defined(RTEMS_MULTIPROCESSING) 69 return _Semaphore_MP_Obtain(
id, option_set, timeout );
75 executing = _Thread_Executing;
84 flags = _Semaphore_Get_flags( the_semaphore );
85 variant = _Semaphore_Get_variant( flags );
88 case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY:
91 CORE_MUTEX_TQ_PRIORITY_INHERIT_OPERATIONS,
98 case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
107 case SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL:
110 _Semaphore_Get_operations( flags ),
117 #if defined(RTEMS_SMP) 118 case SEMAPHORE_VARIANT_MRSP:
129 variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
130 || variant == SEMAPHORE_VARIANT_COUNTING
134 _Semaphore_Get_operations( flags ),
142 return _Status_Get( status );
Thread_queue_Control Wait_queue
The thread queue of this mutex.
Thread queue context for the thread queue methods.
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.
uint32_t rtems_option
This type is used to represent an option set.
CORE_ceiling_mutex_Control Mutex
Thread_queue_Control Wait_queue
The thread queue to manage ownership and waiting threads.
CORE_recursive_mutex_Control Recursive
The plain recursive mutex.
Thread_queue_Control Wait_queue
The thread queue present in all other variants.
static __inline__ Status_Control _CORE_recursive_mutex_Seize_nested(CORE_recursive_mutex_Control *the_mutex)
Seizes the recursive mutex nested.
static __inline__ Status_Control _CORE_ceiling_mutex_Seize(CORE_ceiling_mutex_Control *the_mutex, Thread_Control *executing, bool wait, Status_Control(*nested)(CORE_recursive_mutex_Control *), Thread_queue_Context *queue_context)
Seizes the ceiling mutex.
Classic Options Implementation.
RTEMS_INLINE_ROUTINE bool _Options_Is_no_wait(rtems_option option_set)
Checks if the RTEMS_NO_WAIT option is enabled in option_set.
static __inline__ Status_Control _MRSP_Seize(MRSP_Control *mrsp, Thread_Control *executing, bool wait, Thread_queue_Context *queue_context)
Seizes the MrsP control.
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.
Classic Semaphore Manager Implementation.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Classic Status Implementation.
rtems_status_code rtems_semaphore_obtain(rtems_id id, rtems_option option_set, rtems_interval timeout)
%
CORE_mutex_Control Mutex
The plain non-recursive mutex.
static __inline__ Status_Control _CORE_recursive_mutex_Seize(CORE_recursive_mutex_Control *the_mutex, const Thread_queue_Operations *operations, Thread_Control *executing, bool wait, Status_Control(*nested)(CORE_recursive_mutex_Control *), Thread_queue_Context *queue_context)
Seizes the recursive mutex.
Watchdog_Interval rtems_interval
This type is used to represent clock tick intervals.
This status code indicates that an object identifier was invalid.
Objects_Id rtems_id
Values of this type identify an RTEMS object.
static __inline__ Status_Control _CORE_semaphore_Seize(CORE_semaphore_Control *the_semaphore, const Thread_queue_Operations *operations, Thread_Control *executing, bool wait, Thread_queue_Context *queue_context)
Seizes the semaphore.
CORE_semaphore_Control Semaphore
union Semaphore_Control::@8 Core_control
Semaphore_Variant
Classic semaphore variants.
Thread_queue_Control Wait_queue
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.