summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/mqueuecreatesupp.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/mqueuecreatesupp.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 '')
-rw-r--r--cpukit/posix/src/mqueuecreatesupp.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/cpukit/posix/src/mqueuecreatesupp.c b/cpukit/posix/src/mqueuecreatesupp.c
index 056d35df1b..3be64b4cc4 100644
--- a/cpukit/posix/src/mqueuecreatesupp.c
+++ b/cpukit/posix/src/mqueuecreatesupp.c
@@ -62,8 +62,6 @@ int _POSIX_Message_queue_Create_support(
/* length of name has already been validated */
- _Thread_Disable_dispatch();
-
/*
* There is no real basis for the default values. They will work
* but were not compared against any existing implementation for
@@ -75,12 +73,10 @@ int _POSIX_Message_queue_Create_support(
attr.mq_msgsize = 16;
} else {
if ( attr_ptr->mq_maxmsg <= 0 ){
- _Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( attr_ptr->mq_msgsize <= 0 ){
- _Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EINVAL );
}
@@ -89,7 +85,7 @@ int _POSIX_Message_queue_Create_support(
the_mq = _POSIX_Message_queue_Allocate();
if ( !the_mq ) {
- _Thread_Enable_dispatch();
+ _Objects_Allocator_unlock();
rtems_set_errno_and_return_minus_one( ENFILE );
}
@@ -100,7 +96,7 @@ int _POSIX_Message_queue_Create_support(
name = _Workspace_String_duplicate( name_arg, name_len );
if ( !name ) {
_POSIX_Message_queue_Free( the_mq );
- _Thread_Enable_dispatch();
+ _Objects_Allocator_unlock();
rtems_set_errno_and_return_minus_one( ENOMEM );
}
@@ -128,7 +124,7 @@ int _POSIX_Message_queue_Create_support(
_POSIX_Message_queue_Free( the_mq );
_Workspace_Free(name);
- _Thread_Enable_dispatch();
+ _Objects_Allocator_unlock();
rtems_set_errno_and_return_minus_one( ENOSPC );
}
@@ -140,6 +136,6 @@ int _POSIX_Message_queue_Create_support(
*message_queue = the_mq;
- _Thread_Enable_dispatch();
+ _Objects_Allocator_unlock();
return 0;
}