diff options
Diffstat (limited to 'cpukit/posix/src/mutexdestroy.c')
-rw-r--r-- | cpukit/posix/src/mutexdestroy.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cpukit/posix/src/mutexdestroy.c b/cpukit/posix/src/mutexdestroy.c index 0fad9a915f..fce78af715 100644 --- a/cpukit/posix/src/mutexdestroy.c +++ b/cpukit/posix/src/mutexdestroy.c @@ -39,6 +39,7 @@ int pthread_mutex_destroy( register POSIX_Mutex_Control *the_mutex; Objects_Locations location; + _Objects_Allocator_lock(); the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { @@ -50,15 +51,16 @@ int pthread_mutex_destroy( if ( _CORE_mutex_Is_locked( &the_mutex->Mutex ) ) { _Objects_Put( &the_mutex->Object ); + _Objects_Allocator_unlock(); return EBUSY; } _Objects_Close( &_POSIX_Mutex_Information, &the_mutex->Object ); - _CORE_mutex_Flush( &the_mutex->Mutex, NULL, EINVAL ); - - _POSIX_Mutex_Free( the_mutex ); _Objects_Put( &the_mutex->Object ); + _POSIX_Mutex_Free( the_mutex ); + _Objects_Allocator_unlock(); + return 0; #if defined(RTEMS_MULTIPROCESSING) @@ -68,5 +70,7 @@ int pthread_mutex_destroy( break; } + _Objects_Allocator_unlock(); + return EINVAL; } |