From 23fec9f0e18dc4913fab818118f836af150b98f3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 27 Mar 2014 14:16:12 +0100 Subject: 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. --- cpukit/rtems/src/msgqcreate.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'cpukit/rtems/src/msgqcreate.c') diff --git a/cpukit/rtems/src/msgqcreate.c b/cpukit/rtems/src/msgqcreate.c index 6f60773458..b18f3b2591 100644 --- a/cpukit/rtems/src/msgqcreate.c +++ b/cpukit/rtems/src/msgqcreate.c @@ -81,12 +81,10 @@ rtems_status_code rtems_message_queue_create( #endif #endif - _Thread_Disable_dispatch(); /* protects object pointer */ - the_message_queue = _Message_queue_Allocate(); if ( !the_message_queue ) { - _Thread_Enable_dispatch(); + _Objects_Allocator_unlock(); return RTEMS_TOO_MANY; } @@ -95,7 +93,7 @@ rtems_status_code rtems_message_queue_create( !( _Objects_MP_Allocate_and_open( &_Message_queue_Information, name, the_message_queue->Object.id, false ) ) ) { _Message_queue_Free( the_message_queue ); - _Thread_Enable_dispatch(); + _Objects_Allocator_unlock(); return RTEMS_TOO_MANY; } #endif @@ -120,7 +118,7 @@ rtems_status_code rtems_message_queue_create( #endif _Message_queue_Free( the_message_queue ); - _Thread_Enable_dispatch(); + _Objects_Allocator_unlock(); return RTEMS_UNSATISFIED; } @@ -142,6 +140,6 @@ rtems_status_code rtems_message_queue_create( ); #endif - _Thread_Enable_dispatch(); + _Objects_Allocator_unlock(); return RTEMS_SUCCESSFUL; } -- cgit v1.2.3