mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
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.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
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.
|
||||
|
||||
2008-08-04 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
PR 1265/cpukit
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ void _Thread_Tickle_timeslice( void )
|
||||
|
||||
case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
|
||||
case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
|
||||
if ( --executing->cpu_time_budget == 0 ) {
|
||||
if ( (int)(--executing->cpu_time_budget) <= 0 ) {
|
||||
_Thread_Reset_timeslice();
|
||||
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user