summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Humphrey <glenn.humphrey@oarcorp.com>2009-12-11 22:03:35 +0000
committerGlenn Humphrey <glenn.humphrey@oarcorp.com>2009-12-11 22:03:35 +0000
commit33bdd10ef2b2a31c979afd90bdab8f143782114c (patch)
tree00ac7d1b23c55dd6d30bc6a5ccef1fe72d4a99e6
parent2009-12-10 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-33bdd10ef2b2a31c979afd90bdab8f143782114c.tar.bz2
2009-12-11 Glenn Humphrey <glenn.humphrey@OARcorp.com>
PR 1481/cpukit * rtems/src/ratemonperiod.c: Moved check for cpu usage being smaller than when period initiated.
-rw-r--r--cpukit/ChangeLog6
-rw-r--r--cpukit/rtems/src/ratemonperiod.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 6d30ef8206..e59a645a07 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,9 @@
+2009-12-11 Glenn Humphrey <glenn.humphrey@OARcorp.com>
+
+ PR 1481/cpukit
+ * rtems/src/ratemonperiod.c: Moved check for cpu usage being smaller
+ than when period initiated.
+
2009-12-10 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1482
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c
index 4ce1cab7f6..2387da0c31 100644
--- a/cpukit/rtems/src/ratemonperiod.c
+++ b/cpukit/rtems/src/ratemonperiod.c
@@ -135,16 +135,16 @@ 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);
/* executed += ran */
_Timespec_Add_to( &used, &ran );
+ /* partial period, cpu usage info reset while executing. Throw away */
+ if (_Timespec_Less_than( &used, &the_period->owner_executed_at_period))
+ return;
+
/* executed = current cpu usage - value at start of period */
_Timespec_Subtract(
&the_period->owner_executed_at_period, &used, &executed