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/conddestroy.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/conddestroy.c')
-rw-r--r-- | cpukit/posix/src/conddestroy.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |