From 8a77ef63de3caaa9742b8b0faccd0258b98fa680 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 27 May 2016 09:34:17 +0200 Subject: rtems: Simplify rtems_semaphore_flush() Due to the unified status codes, we can now use a common flush method for semaphore and mutex variants. --- cpukit/rtems/src/semflush.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cpukit/rtems/src/semflush.c b/cpukit/rtems/src/semflush.c index 2410ed2386..0db8c34dfb 100644 --- a/cpukit/rtems/src/semflush.c +++ b/cpukit/rtems/src/semflush.c @@ -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; -- cgit v1.2.3