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/posix/src/timercreate.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cpukit/posix/src/timercreate.c') diff --git a/cpukit/posix/src/timercreate.c b/cpukit/posix/src/timercreate.c index f55e2db8d6..6d822b3928 100644 --- a/cpukit/posix/src/timercreate.c +++ b/cpukit/posix/src/timercreate.c @@ -66,21 +66,19 @@ int timer_create( rtems_set_errno_and_return_minus_one( EINVAL ); } - _Thread_Disable_dispatch(); /* to prevent deletion */ - /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { - _Objects_Put( &ptimer->Object ); + _Objects_Allocator_unlock(); rtems_set_errno_and_return_minus_one( EAGAIN ); } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; - ptimer->thread_id = _Thread_Executing->Object.id; + ptimer->thread_id = _Thread_Get_executing()->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; @@ -98,6 +96,6 @@ int timer_create( _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; - _Objects_Put( &ptimer->Object ); + _Objects_Allocator_unlock(); return 0; } -- cgit v1.2.3