diff options
Diffstat (limited to 'cpukit/rtems/src/ratemonperiod.c')
-rw-r--r-- | cpukit/rtems/src/ratemonperiod.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c index 23f70c58a0..26db51f43b 100644 --- a/cpukit/rtems/src/ratemonperiod.c +++ b/cpukit/rtems/src/ratemonperiod.c @@ -74,6 +74,10 @@ void _Rate_monotonic_Update_statistics( /* Grab CPU usage when the thread got switched in */ used = _Thread_Executing->cpu_time_used; + /* partial period, cpu usage info reset while executing. Throw away */ + if (_Timespec_Less_than( &used, &the_period->owner_executed_at_period)) + return; + /* How much time time since last context switch */ _Timespec_Subtract(&_Thread_Time_of_last_context_switch, &uptime, &ran); |