diff options
Diffstat (limited to 'cpukit/rtems/src/partdelete.c')
-rw-r--r-- | cpukit/rtems/src/partdelete.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpukit/rtems/src/partdelete.c b/cpukit/rtems/src/partdelete.c index cc10abcded..032f73d3d0 100644 --- a/cpukit/rtems/src/partdelete.c +++ b/cpukit/rtems/src/partdelete.c @@ -29,13 +29,13 @@ rtems_status_code rtems_partition_delete( Partition_Control *the_partition; Objects_Locations location; + _Objects_Allocator_lock(); the_partition = _Partition_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_partition->number_of_used_blocks == 0 ) { _Objects_Close( &_Partition_Information, &the_partition->Object ); - _Partition_Free( the_partition ); #if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( the_partition->attribute_set ) ) { @@ -54,14 +54,17 @@ rtems_status_code rtems_partition_delete( #endif _Objects_Put( &the_partition->Object ); + _Partition_Free( the_partition ); + _Objects_Allocator_unlock(); return RTEMS_SUCCESSFUL; } _Objects_Put( &the_partition->Object ); + _Objects_Allocator_unlock(); return RTEMS_RESOURCE_IN_USE; #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: - _Thread_Dispatch(); + _Objects_Allocator_unlock(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; #endif @@ -69,5 +72,7 @@ rtems_status_code rtems_partition_delete( break; } + _Objects_Allocator_unlock(); + return RTEMS_INVALID_ID; } |