summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2004-07-25 15:00:04 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2004-07-25 15:00:04 +0000
commite9f6d10f4d968662b22a57dfa5882d48f380b364 (patch)
treec71ed3913539abdf2aa5eff9d3bff7d4d392cdf7 /cpukit
parent2004-07-25 Victor Vengerov <Victor.Vengerov@oktetlabs.ru> (diff)
downloadrtems-e9f6d10f4d968662b22a57dfa5882d48f380b364.tar.bz2
2004-07-25 Thomas Rauscher <trauscher@loytec.com>
PR 609/rtems * score/src/threaddispatch.c: Close race condition between _Thread_Dispatch and _Thread_Tickle_timeslice.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog6
-rw-r--r--cpukit/score/src/threaddispatch.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 65a4a431ae..65d1a7a6d5 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-25 Thomas Rauscher <trauscher@loytec.com>
+
+ PR 609/rtems
+ * score/src/threaddispatch.c: Close race condition between
+ _Thread_Dispatch and _Thread_Tickle_timeslice.
+
2004-07-25 Victor Vengerov <Victor.Vengerov@oktetlabs.ru>
PR 654/rtems
diff --git a/cpukit/score/src/threaddispatch.c b/cpukit/score/src/threaddispatch.c
index a4f5a1072f..e1b730052d 100644
--- a/cpukit/score/src/threaddispatch.c
+++ b/cpukit/score/src/threaddispatch.c
@@ -70,6 +70,8 @@ void _Thread_Dispatch( void )
_Thread_Executing = heir;
executing->rtems_ada_self = rtems_ada_self;
rtems_ada_self = heir->rtems_ada_self;
+ if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
+ heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
_ISR_Enable( level );
heir->ticks_executed++;
@@ -84,9 +86,6 @@ void _Thread_Dispatch( void )
_User_extensions_Thread_switch( executing, heir );
- if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
- heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
-
/*
* If the CPU has hardware floating point, then we must address saving
* and restoring it as part of the context switch.