diff options
Diffstat (limited to 'cpukit/rtems/src/semflush.c')
-rw-r--r-- | cpukit/rtems/src/semflush.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/cpukit/rtems/src/semflush.c b/cpukit/rtems/src/semflush.c index b7e8786f76..13c0e8d387 100644 --- a/cpukit/rtems/src/semflush.c +++ b/cpukit/rtems/src/semflush.c @@ -24,6 +24,8 @@ rtems_status_code rtems_semaphore_flush( rtems_id id ) { Semaphore_Control *the_semaphore; Thread_queue_Context queue_context; + uintptr_t flags; + Semaphore_Variant variant; the_semaphore = _Semaphore_Get( id, &queue_context ); @@ -45,8 +47,10 @@ rtems_status_code rtems_semaphore_flush( rtems_id id ) &queue_context, _Semaphore_MP_Send_object_was_deleted ); + flags = _Semaphore_Get_flags( the_semaphore ); + variant = _Semaphore_Get_variant( flags ); - switch ( the_semaphore->variant ) { + switch ( variant ) { #if defined(RTEMS_SMP) case SEMAPHORE_VARIANT_MRSP: _Thread_queue_Release( @@ -57,15 +61,15 @@ rtems_status_code rtems_semaphore_flush( rtems_id id ) #endif default: _Assert( - the_semaphore->variant == SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY - || the_semaphore->variant == SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING - || the_semaphore->variant == SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL - || the_semaphore->variant == SEMAPHORE_VARIANT_SIMPLE_BINARY - || the_semaphore->variant == SEMAPHORE_VARIANT_COUNTING + variant == SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY + || variant == SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING + || variant == SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL + || variant == SEMAPHORE_VARIANT_SIMPLE_BINARY + || variant == SEMAPHORE_VARIANT_COUNTING ); _Thread_queue_Flush_critical( &the_semaphore->Core_control.Wait_queue.Queue, - _Semaphore_Get_operations( the_semaphore ), + _Semaphore_Get_operations( flags ), _Thread_queue_Flush_status_unavailable, &queue_context ); |