diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-04 09:22:26 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-19 12:00:43 +0200 |
commit | 5f7f469a96bf8ffeab37f782062d13344e375b4a (patch) | |
tree | 8e45c9e035dcf2c06052a79fbd3175b1b8cd8975 /cpukit/libcsupport | |
parent | rtems: Use once mutex for timer server init (diff) | |
download | rtems-5f7f469a96bf8ffeab37f782062d13344e375b4a.tar.bz2 |
libcsupport: Avoid Giant lock in _times()
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r-- | cpukit/libcsupport/src/__times.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpukit/libcsupport/src/__times.c b/cpukit/libcsupport/src/__times.c index 5a1f9eba4d..895ee6b658 100644 --- a/cpukit/libcsupport/src/__times.c +++ b/cpukit/libcsupport/src/__times.c @@ -66,9 +66,10 @@ clock_t _times( #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { - Timestamp_Control per_tick; - uint32_t ticks_of_executing; - uint32_t fractional_ticks; + Timestamp_Control per_tick; + uint32_t ticks_of_executing; + uint32_t fractional_ticks; + Per_CPU_Control *cpu_self; _Timestamp_Set( &per_tick, @@ -78,7 +79,7 @@ clock_t _times( TOD_NANOSECONDS_PER_SECOND) ); - _Thread_Disable_dispatch(); + cpu_self = _Thread_Dispatch_disable(); executing = _Thread_Executing; _Thread_Update_cpu_time_used( executing, @@ -90,7 +91,7 @@ clock_t _times( &ticks_of_executing, &fractional_ticks ); - _Thread_Enable_dispatch(); + _Thread_Dispatch_enable( cpu_self ); ptms->tms_utime = ticks_of_executing * us_per_tick; } #else |