summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/timercreate.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/timercreate.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/timercreate.c')
-rw-r--r--cpukit/posix/src/timercreate.c8
1 files changed, 3 insertions, 5 deletions
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;
}