summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/taskmode.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-05 13:10:16 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-05 13:10:16 +0000
commitc0f4682bbf1d570171a838f15973d0a02c092fb2 (patch)
tree6c36efb90a996921b9c2b4dc78648759429e4087 /cpukit/rtems/src/taskmode.c
parent2008-08-04 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-c0f4682bbf1d570171a838f15973d0a02c092fb2.tar.bz2
2008-08-05 Xudong Guan <xudong.guan@criticalsoftware.com>
PR 1212/cpukit * rtems/src/taskmode.c, score/src/threadtickletimeslice.c: Time slicing will not happen if the task mode is changed from a non-timeslicing mode to timeslicing mode if it is done by the executing thread (e.g. in its task body). This change includes sp44 to demonstrate the problem and verify the correction.
Diffstat (limited to '')
-rw-r--r--cpukit/rtems/src/taskmode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c
index 4deccf4918..65fc07a81f 100644
--- a/cpukit/rtems/src/taskmode.c
+++ b/cpukit/rtems/src/taskmode.c
@@ -89,9 +89,10 @@ rtems_status_code rtems_task_mode(
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? TRUE : FALSE;
if ( mask & RTEMS_TIMESLICE_MASK ) {
- if ( _Modes_Is_timeslice(mode_set) )
+ if ( _Modes_Is_timeslice(mode_set) ) {
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
- else
+ executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
+ } else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
}