summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-10-15 21:38:43 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-10-15 21:38:43 +0000
commit27f0d424951674701ed833d84da3849e1a63d512 (patch)
treed4c24b4027b4aaa729804bae8884f3cb0b10f2fc /cpukit/score/src
parentadded cpu time used field to tcb (diff)
downloadrtems-27f0d424951674701ed833d84da3849e1a63d512.tar.bz2
added support for cpu time used field in tcb
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/thread.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c
index 9060185348..8024b51dbf 100644
--- a/cpukit/score/src/thread.c
+++ b/cpukit/score/src/thread.c
@@ -518,6 +518,7 @@ boolean _Thread_Initialize(
the_thread->resource_count = 0;
the_thread->real_priority = priority;
the_thread->Start.initial_priority = priority;
+ the_thread->ticks_executed = 0;
_Thread_Set_priority( the_thread, priority );
@@ -945,12 +946,27 @@ void _Thread_Tickle_timeslice( void )
executing = _Thread_Executing;
+ /*
+ * Increment the number of ticks this thread has been executing
+ */
+
+ executing->ticks_executed++;
+
+ /*
+ * If the thread is not preemptible or is not ready, then
+ * just return.
+ */
+
if ( !executing->is_preemptible )
return;
if ( !_States_Is_ready( executing->current_state ) )
return;
+ /*
+ * The cpu budget algorithm determines what happens next.
+ */
+
switch ( executing->budget_algorithm ) {
case THREAD_CPU_BUDGET_ALGORITHM_NONE:
break;