diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-07-06 19:35:44 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-07-06 19:35:44 +0000 |
commit | ab654be428fd4d086d5d700be405856d989c6ab1 (patch) | |
tree | bcf56e47f536b32fe3faa404293e3eeabfd25f18 /c/src/exec/rtems | |
parent | Switched to using _POSIX_Mutex_Get_interrupt_disable to improve performance. (diff) | |
download | rtems-ab654be428fd4d086d5d700be405856d989c6ab1.tar.bz2 |
Cleaned up to avoid disruptive use of inline conditionals.
Diffstat (limited to 'c/src/exec/rtems')
-rw-r--r-- | c/src/exec/rtems/src/semrelease.c | 34 |
1 files changed, 16 insertions, 18 deletions
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 */ |