summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/mqueueunlink.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/posix/src/mqueueunlink.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/posix/src/mqueueunlink.c')
-rw-r--r--cpukit/posix/src/mqueueunlink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cpukit/posix/src/mqueueunlink.c b/cpukit/posix/src/mqueueunlink.c
index 47a0f5a368..92b1976a43 100644
--- a/cpukit/posix/src/mqueueunlink.c
+++ b/cpukit/posix/src/mqueueunlink.c
@@ -46,11 +46,13 @@ int mq_unlink(
Objects_Id the_mq_id;
size_t name_len;
+ _Objects_Allocator_lock();
_Thread_Disable_dispatch();
status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id, &name_len );
if ( status != 0 ) {
_Thread_Enable_dispatch();
+ _Objects_Allocator_unlock();
rtems_set_errno_and_return_minus_one( status );
}
@@ -64,5 +66,6 @@ int mq_unlink(
_POSIX_Message_queue_Delete( the_mq );
_Thread_Enable_dispatch();
+ _Objects_Allocator_unlock();
return 0;
}