diff options
Diffstat (limited to '')
-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; } |