35 Status_Control status;
37 the_semaphore = _Semaphore_Get(
id, &queue_context );
39 if ( the_semaphore == NULL ) {
40 #if defined(RTEMS_MULTIPROCESSING) 41 return _Semaphore_MP_Release(
id );
47 executing = _Thread_Executing;
51 _Semaphore_Core_mutex_mp_support
53 flags = _Semaphore_Get_flags( the_semaphore );
54 variant = _Semaphore_Get_variant( flags );
57 case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY:
60 CORE_MUTEX_TQ_PRIORITY_INHERIT_OPERATIONS,
65 case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
72 case SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL:
75 _Semaphore_Get_operations( flags ),
80 case SEMAPHORE_VARIANT_SIMPLE_BINARY:
83 _Semaphore_Get_operations( flags ),
88 status == STATUS_SUCCESSFUL
89 || status == STATUS_MAXIMUM_COUNT_EXCEEDED
91 status = STATUS_SUCCESSFUL;
93 #if defined(RTEMS_SMP) 94 case SEMAPHORE_VARIANT_MRSP:
103 _Assert( variant == SEMAPHORE_VARIANT_COUNTING );
106 _Semaphore_Get_operations( flags ),
113 return _Status_Get( status );
Thread queue context for the thread queue methods.
#define _Thread_queue_Context_set_MP_callout(queue_context, mp_callout)
Sets the MP callout in the thread queue context.
static __inline__ Status_Control _CORE_semaphore_Surrender(CORE_semaphore_Control *the_semaphore, const Thread_queue_Operations *operations, uint32_t maximum_count, Thread_queue_Context *queue_context)
Surrenders a unit to the semaphore.
CORE_ceiling_mutex_Control Mutex
CORE_recursive_mutex_Control Recursive
The plain recursive mutex.
rtems_status_code rtems_semaphore_release(rtems_id id)
%
Classic Semaphore Manager Implementation.
static __inline__ Status_Control _CORE_ceiling_mutex_Surrender(CORE_ceiling_mutex_Control *the_mutex, Thread_Control *executing, Thread_queue_Context *queue_context)
Surrenders the ceiling mutex.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Classic Status Implementation.
static __inline__ Status_Control _MRSP_Surrender(MRSP_Control *mrsp, Thread_Control *executing, Thread_queue_Context *queue_context)
Surrenders the MrsP control.
This status code indicates that an object identifier was invalid.
Objects_Id rtems_id
Values of this type identify an RTEMS object.
CORE_semaphore_Control Semaphore
union Semaphore_Control::@8 Core_control
Semaphore_Variant
Classic semaphore variants.
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.
static __inline__ Status_Control _CORE_recursive_mutex_Surrender(CORE_recursive_mutex_Control *the_mutex, const Thread_queue_Operations *operations, Thread_Control *executing, Thread_queue_Context *queue_context)
Surrenders the recursive mutex.