From ab654be428fd4d086d5d700be405856d989c6ab1 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 6 Jul 2000 19:35:44 +0000 Subject: Cleaned up to avoid disruptive use of inline conditionals. --- c/src/exec/rtems/src/semrelease.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'c/src/exec/rtems') diff --git a/c/src/exec/rtems/src/semrelease.c b/c/src/exec/rtems/src/semrelease.c index 2f05b6503f..7c2a395f38 100644 --- a/c/src/exec/rtems/src/semrelease.c +++ b/c/src/exec/rtems/src/semrelease.c @@ -59,6 +59,12 @@ * error code - if unsuccessful */ +#if defined(RTEMS_MULTIPROCESSING) +#define MUTEX_MP_SUPPORT _Semaphore_Core_mutex_mp_support +#else +#define MUTEX_MP_SUPPORT NULL +#endif + rtems_status_code rtems_semaphore_release( Objects_Id id ) @@ -87,30 +93,22 @@ rtems_status_code rtems_semaphore_release( case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { mutex_status = _CORE_mutex_Surrender( - &the_semaphore->Core_control.mutex, - id, -#if defined(RTEMS_MULTIPROCESSING) - _Semaphore_Core_mutex_mp_support -#else - NULL -#endif - ); + &the_semaphore->Core_control.mutex, + id, + MUTEX_MP_SUPPORT + ); _Thread_Enable_dispatch(); return _Semaphore_Translate_core_mutex_return_code( mutex_status ); - } - else + } else { semaphore_status = _CORE_semaphore_Surrender( - &the_semaphore->Core_control.semaphore, - id, -#if defined(RTEMS_MULTIPROCESSING) - _Semaphore_Core_semaphore_mp_support -#else - NULL -#endif - ); + &the_semaphore->Core_control.semaphore, + id, + MUTEX_MP_SUPPORT + ); _Thread_Enable_dispatch(); return _Semaphore_Translate_core_semaphore_return_code( semaphore_status ); + } } return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */ -- cgit v1.2.3