diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-27 14:16:12 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-31 08:29:44 +0200 |
commit | 23fec9f0e18dc4913fab818118f836af150b98f3 (patch) | |
tree | 66228f23bbf654117a33e28db7a017eea21fb785 /cpukit/posix/src/timerdelete.c | |
parent | score: Use thread life protection for API mutexes (diff) | |
download | rtems-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/timerdelete.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cpukit/posix/src/timerdelete.c b/cpukit/posix/src/timerdelete.c index 5ebf8f8660..71b25faed9 100644 --- a/cpukit/posix/src/timerdelete.c +++ b/cpukit/posix/src/timerdelete.c @@ -47,6 +47,7 @@ int timer_delete( POSIX_Timer_Control *ptimer; Objects_Locations location; + _Objects_Allocator_lock(); ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { @@ -54,8 +55,10 @@ int timer_delete( _Objects_Close( &_POSIX_Timer_Information, &ptimer->Object ); ptimer->state = POSIX_TIMER_STATE_FREE; (void) _Watchdog_Remove( &ptimer->Timer ); - _POSIX_Timer_Free( ptimer ); _Objects_Put( &ptimer->Object ); + _POSIX_Timer_Free( ptimer ); + _Objects_Allocator_unlock(); + return 0; #if defined(RTEMS_MULTIPROCESSING) @@ -65,5 +68,7 @@ int timer_delete( break; } + _Objects_Allocator_unlock(); + rtems_set_errno_and_return_minus_one( EINVAL ); } |