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/ratemoncreate.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cpukit/rtems/src/ratemoncreate.c') diff --git a/cpukit/rtems/src/ratemoncreate.c b/cpukit/rtems/src/ratemoncreate.c index ce0e1de26b..1f597ec944 100644 --- a/cpukit/rtems/src/ratemoncreate.c +++ b/cpukit/rtems/src/ratemoncreate.c @@ -55,16 +55,14 @@ rtems_status_code rtems_rate_monotonic_create( if ( !id ) return RTEMS_INVALID_ADDRESS; - _Thread_Disable_dispatch(); /* to prevent deletion */ - the_period = _Rate_monotonic_Allocate(); if ( !the_period ) { - _Thread_Enable_dispatch(); + _Objects_Allocator_unlock(); return RTEMS_TOO_MANY; } - the_period->owner = _Thread_Executing; + the_period->owner = _Thread_Get_executing(); the_period->state = RATE_MONOTONIC_INACTIVE; _Watchdog_Initialize( &the_period->Timer, NULL, 0, NULL ); @@ -78,6 +76,6 @@ rtems_status_code rtems_rate_monotonic_create( ); *id = the_period->Object.id; - _Thread_Enable_dispatch(); + _Objects_Allocator_unlock(); return RTEMS_SUCCESSFUL; } -- cgit v1.2.3