diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-27 14:16:12 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-31 08:29:44 +0200 |
commit | 23fec9f0e18dc4913fab818118f836af150b98f3 (patch) | |
tree | 66228f23bbf654117a33e28db7a017eea21fb785 /cpukit/posix/src/mutexdestroy.c | |
parent | score: Use thread life protection for API mutexes (diff) | |
download | rtems-23fec9f0e18dc4913fab818118f836af150b98f3.tar.bz2 |
score: PR2152: Use allocator mutex for objects
Use allocator mutex for objects allocate/free. This prevents that the
thread dispatch latency depends on the workspace/heap fragmentation.
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; } |