summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/partdelete.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-27 14:16:12 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-31 08:29:44 +0200
commit23fec9f0e18dc4913fab818118f836af150b98f3 (patch)
tree66228f23bbf654117a33e28db7a017eea21fb785 /cpukit/rtems/src/partdelete.c
parentscore: Use thread life protection for API mutexes (diff)
downloadrtems-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/rtems/src/partdelete.c')
-rw-r--r--cpukit/rtems/src/partdelete.c9
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;
}