32 Status_Control status;
35 the_semaphore = _Semaphore_Get(
id, &queue_context );
37 if ( the_semaphore == NULL ) {
40 #if defined(RTEMS_MULTIPROCESSING) 41 if ( _Semaphore_MP_Is_remote(
id ) ) {
53 flags = _Semaphore_Get_flags( the_semaphore );
54 variant = _Semaphore_Get_variant( flags );
57 case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY:
58 case SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING:
59 case SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL:
65 status = STATUS_RESOURCE_IN_USE;
67 status = STATUS_SUCCESSFUL;
71 #if defined(RTEMS_SMP) 72 case SEMAPHORE_VARIANT_MRSP:
78 variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
79 || variant == SEMAPHORE_VARIANT_COUNTING
81 status = STATUS_SUCCESSFUL;
85 if ( status != STATUS_SUCCESSFUL ) {
91 return _Status_Get( status );
97 #if defined(RTEMS_SMP) 98 case SEMAPHORE_VARIANT_MRSP:
104 variant == SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY
105 || variant == SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING
106 || variant == SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL
107 || variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
108 || variant == SEMAPHORE_VARIANT_COUNTING
112 _Semaphore_Get_operations( flags ),
120 #if defined(RTEMS_MULTIPROCESSING) 121 if ( _Semaphore_Is_global( flags ) ) {
125 _Semaphore_MP_Send_process_packet(
126 SEMAPHORE_MP_ANNOUNCE_DELETE,
static __inline__ void _Thread_queue_Acquire_critical(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Acquires the thread queue control in a critical section.
static __inline__ void _Objects_Allocator_unlock(void)
Unlocks the object allocator mutex.
Thread queue context for the thread queue methods.
static __inline__ bool _CORE_mutex_Is_locked(const CORE_mutex_Control *the_mutex)
Checks if the mutex is locked.
CORE_ceiling_mutex_Control Mutex
CORE_recursive_mutex_Control Recursive
The plain recursive mutex.
Thread_queue_Control Wait_queue
The thread queue present in all other variants.
Objects_Control Object
The object management portion of a semaphore instance.
static __inline__ void _Objects_Allocator_lock(void)
Locks the object allocator mutex.
Thread_queue_Queue Queue
The actual thread queue.
This status code indicates successful completion.
Classic Semaphore Manager Implementation.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
size_t _Thread_queue_Flush_critical(Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_queue_Flush_filter filter, Thread_queue_Context *queue_context)
Unblocks all threads enqueued on the thread queue.
Classic Status Implementation.
CORE_mutex_Control Mutex
The plain non-recursive mutex.
static __inline__ void _Semaphore_Free(Semaphore_Control *the_semaphore)
Frees a semaphore control block to the inactive chain of free semaphore control blocks.
Thread_Control * _Thread_queue_Flush_status_object_was_deleted(Thread_Control *the_thread, Thread_queue_Queue *queue, Thread_queue_Context *queue_context)
Status object was deleted thread queue flush filter function.
This status code indicates that an object identifier was invalid.
Objects_Id rtems_id
Values of this type identify an RTEMS object.
This status code indicates that the operation was illegal on a remote object.
Objects_Information _Semaphore_Information
The Classic Semaphore objects information.
static __inline__ Status_Control _MRSP_Can_destroy(MRSP_Control *mrsp)
Checks if the MrsP control can be destroyed.
static __inline__ void _MRSP_Destroy(MRSP_Control *mrsp, Thread_queue_Context *queue_context)
Destroys the MrsP control.
static __inline__ void _Thread_queue_Destroy(Thread_queue_Control *the_thread_queue)
Destroys the thread queue.
void _Thread_queue_Release(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Releases the thread queue control and enables interrupts.
rtems_status_code rtems_semaphore_delete(rtems_id id)
%
union Semaphore_Control::@8 Core_control
Semaphore_Variant
Classic semaphore variants.
void _Objects_Close(const Objects_Information *information, Objects_Control *the_object)
Closes object.
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.