Skip to content

Commit 5748762

Browse files
hunterhu3000nashif
authored andcommitted
kernel: Init the base.slice_ticks for dummy_thread
Fixes #46324 Set dummy_thread->base.slice_ticks to 0 when CONFIG_TIMESLICE_PER_THREAD is set. To avoid _current_cpu->slice_ticks be a big number. Signed-off-by: Hu Zhenyu <[email protected]>
1 parent 6c67239 commit 5748762

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kernel/include/kswap.h

+4
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ static inline void z_dummy_thread_init(struct k_thread *dummy_thread)
232232
dummy_thread->resource_pool = NULL;
233233
#endif
234234

235+
#ifdef CONFIG_TIMESLICE_PER_THREAD
236+
dummy_thread->base.slice_ticks = 0;
237+
#endif
238+
235239
_current_cpu->current = dummy_thread;
236240
}
237241
#endif /* ZEPHYR_KERNEL_INCLUDE_KSWAP_H_ */

0 commit comments

Comments
 (0)