kernel: timeout: do not active time slicing if idle thread ready

zero slice_ticks when can't time slice so that next_timeout will
ignore slice_ticks of _current_cpu and system can stay low power
state longer time.

Fixes: #17368.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
This commit is contained in:
Wentong Wu 2019-07-24 17:17:33 +08:00 committed by Andrew Boie
commit 2463ded4c8

View file

@ -297,6 +297,8 @@ void z_time_slice(int ticks)
} else {
_current_cpu->slice_ticks -= ticks;
}
} else {
_current_cpu->slice_ticks = 0;
}
}
#else