From b8bdced14d82d07965a6fa45bb80687420bdbd8a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 18 Apr 2016 17:21:43 +0200 Subject: posix: Simplify _POSIX_Mutex_Get_interrupt_disable Remove superfluous location parameter. --- cpukit/posix/src/mutexunlock.c | 45 ++++++++++++------------------------------ 1 file changed, 13 insertions(+), 32 deletions(-) (limited to 'cpukit/posix/src/mutexunlock.c') diff --git a/cpukit/posix/src/mutexunlock.c b/cpukit/posix/src/mutexunlock.c index 1a83a0a241..4de1917648 100644 --- a/cpukit/posix/src/mutexunlock.c +++ b/cpukit/posix/src/mutexunlock.c @@ -18,14 +18,7 @@ #include "config.h" #endif -#include -#include - -#include -#include -#include #include -#include /* * 11.3.3 Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 @@ -37,33 +30,21 @@ int pthread_mutex_unlock( pthread_mutex_t *mutex ) { - register POSIX_Mutex_Control *the_mutex; - Objects_Locations location; - CORE_mutex_Status status; - ISR_lock_Context lock_context; - - the_mutex = _POSIX_Mutex_Get_interrupt_disable( - mutex, - &location, - &lock_context - ); - switch ( location ) { + POSIX_Mutex_Control *the_mutex; + CORE_mutex_Status status; + ISR_lock_Context lock_context; - case OBJECTS_LOCAL: - status = _CORE_mutex_Surrender( - &the_mutex->Mutex, - NULL, - 0, - &lock_context - ); - return _POSIX_Mutex_Translate_core_mutex_return_code( status ); + the_mutex = _POSIX_Mutex_Get_interrupt_disable( mutex, &lock_context ); -#if defined(RTEMS_MULTIPROCESSING) - case OBJECTS_REMOTE: -#endif - case OBJECTS_ERROR: - break; + if ( the_mutex == NULL ) { + return EINVAL; } - return EINVAL; + status = _CORE_mutex_Surrender( + &the_mutex->Mutex, + NULL, + 0, + &lock_context + ); + return _POSIX_Mutex_Translate_core_mutex_return_code( status ); } -- cgit v1.2.3