diff options
Diffstat (limited to '')
-rw-r--r-- | cpukit/posix/src/mutexget.c | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/cpukit/posix/src/mutexget.c b/cpukit/posix/src/mutexget.c index 9d34ecb583..97d6dff658 100644 --- a/cpukit/posix/src/mutexget.c +++ b/cpukit/posix/src/mutexget.c @@ -19,50 +19,19 @@ #endif #include <rtems/posix/muteximpl.h> -#include <rtems/score/apimutex.h> - -static bool _POSIX_Mutex_Check_id_and_auto_init( pthread_mutex_t *mutex ) -{ - if ( mutex == NULL ) { - return false; - } - - if ( *mutex == PTHREAD_MUTEX_INITIALIZER ) { - int eno; - - _Once_Lock(); - - if ( *mutex == PTHREAD_MUTEX_INITIALIZER ) { - eno = pthread_mutex_init( mutex, NULL ); - } else { - eno = 0; - } - - _Once_Unlock(); - - if ( eno != 0 ) { - return false; - } - } - - return true; -} +#include <rtems/posix/posixapi.h> POSIX_Mutex_Control *_POSIX_Mutex_Get_interrupt_disable( pthread_mutex_t *mutex, ISR_lock_Context *lock_context ) { - Objects_Locations location; - - if ( !_POSIX_Mutex_Check_id_and_auto_init( mutex ) ) { - return NULL; - } - - return (POSIX_Mutex_Control *) _Objects_Get_isr_disable( + _POSIX_Get_object_body( + POSIX_Mutex_Control, + mutex, + lock_context, &_POSIX_Mutex_Information, - (Objects_Id) *mutex, - &location, - lock_context + PTHREAD_MUTEX_INITIALIZER, + pthread_mutex_init ); } |