From c0f4682bbf1d570171a838f15973d0a02c092fb2 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 5 Aug 2008 13:10:16 +0000 Subject: 2008-08-05 Xudong Guan 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. --- cpukit/rtems/src/taskmode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cpukit/rtems') 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; } -- cgit v1.2.3