From 23fec9f0e18dc4913fab818118f836af150b98f3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 27 Mar 2014 14:16:12 +0100 Subject: 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. --- cpukit/posix/src/conddestroy.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cpukit/posix/src/conddestroy.c') diff --git a/cpukit/posix/src/conddestroy.c b/cpukit/posix/src/conddestroy.c index 75bf4cd621..cd437a9114 100644 --- a/cpukit/posix/src/conddestroy.c +++ b/cpukit/posix/src/conddestroy.c @@ -38,6 +38,7 @@ int pthread_cond_destroy( POSIX_Condition_variables_Control *the_cond; Objects_Locations location; + _Objects_Allocator_lock(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { @@ -45,6 +46,7 @@ int pthread_cond_destroy( if ( _Thread_queue_First( &the_cond->Wait_queue ) ) { _Objects_Put( &the_cond->Object ); + _Objects_Allocator_unlock(); return EBUSY; } @@ -52,9 +54,9 @@ int pthread_cond_destroy( &_POSIX_Condition_variables_Information, &the_cond->Object ); - - _POSIX_Condition_variables_Free( the_cond ); _Objects_Put( &the_cond->Object ); + _POSIX_Condition_variables_Free( the_cond ); + _Objects_Allocator_unlock(); return 0; #if defined(RTEMS_MULTIPROCESSING) @@ -64,5 +66,7 @@ int pthread_cond_destroy( break; } + _Objects_Allocator_unlock(); + return EINVAL; } -- cgit v1.2.3