diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-27 09:34:17 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-30 16:16:22 +0200 |
commit | 8a77ef63de3caaa9742b8b0faccd0258b98fa680 (patch) | |
tree | d57420f162e2de6a75b55ffed1a7d5a039ee98bd | |
parent | score: Simplify CORE mutex (diff) | |
download | rtems-8a77ef63de3caaa9742b8b0faccd0258b98fa680.tar.bz2 |
rtems: Simplify rtems_semaphore_flush()
Due to the unified status codes, we can now use a common flush method
for semaphore and mutex variants.
-rw-r--r-- | cpukit/rtems/src/semflush.c | 15 |
1 files 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; |