rtems: Simplify rtems_semaphore_flush()

Due to the unified status codes, we can now use a common flush method
for semaphore and mutex variants.
This commit is contained in:
Sebastian Huber
2016-05-30 16:16:22 +02:00
parent 09c5ca4cb4
commit 8a77ef63de
+5 -10
View File
@@ -55,21 +55,16 @@ rtems_status_code rtems_semaphore_flush( rtems_id id )
);
return RTEMS_NOT_DEFINED;
#endif
case SEMAPHORE_VARIANT_MUTEX:
_CORE_mutex_Flush(
&the_semaphore->Core_control.mutex,
_Thread_queue_Flush_status_unavailable,
&queue_context
);
break;
default:
_Assert(
the_semaphore->variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
the_semaphore->variant == SEMAPHORE_VARIANT_MUTEX
|| the_semaphore->variant == SEMAPHORE_VARIANT_SIMPLE_BINARY
|| the_semaphore->variant == SEMAPHORE_VARIANT_COUNTING
);
_CORE_semaphore_Flush(
&the_semaphore->Core_control.semaphore,
_Thread_queue_Flush_critical(
&the_semaphore->Core_control.Wait_queue.Queue,
_Semaphore_Get_operations( the_semaphore ),
_Thread_queue_Flush_status_unavailable,
&queue_context
);
break;