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/pbarrierdestroy.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 '')
-rw-r--r-- | cpukit/posix/src/pbarrierdestroy.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cpukit/posix/src/pbarrierdestroy.c b/cpukit/posix/src/pbarrierdestroy.c index d2eb50530d..4b9a0fdca9 100644 --- a/cpukit/posix/src/pbarrierdestroy.c +++ b/cpukit/posix/src/pbarrierdestroy.c @@ -45,6 +45,7 @@ int pthread_barrier_destroy( if ( !barrier ) return EINVAL; + _Objects_Allocator_lock(); the_barrier = _POSIX_Barrier_Get( barrier, &location ); switch ( location ) { @@ -55,10 +56,10 @@ int pthread_barrier_destroy( } _Objects_Close( &_POSIX_Barrier_Information, &the_barrier->Object ); + _Objects_Put( &the_barrier->Object ); _POSIX_Barrier_Free( the_barrier ); - - _Objects_Put( &the_barrier->Object ); + _Objects_Allocator_unlock(); return 0; #if defined(RTEMS_MULTIPROCESSING) @@ -68,5 +69,7 @@ int pthread_barrier_destroy( break; } + _Objects_Allocator_unlock(); + return EINVAL; } |