kernel: initialize system work queue after kernel is up The system work queue spawns a coop thread to hanlde the work items. If it is spawned before the kernel is up and the initialization dummy thread's priority is lower, there will be a context switch into the system work queue's thread at that time, before the kernel is ready to handle this. Change-Id: I879659ab58231c5a5cfaa34f2f65c2eccab99142 Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
diff --git a/kernel/unified/system_work_q.c b/kernel/unified/system_work_q.c index 6c18e26..6236c61 100644 --- a/kernel/unified/system_work_q.c +++ b/kernel/unified/system_work_q.c
@@ -40,4 +40,4 @@ return 0; } -SYS_INIT(k_sys_work_q_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +SYS_INIT(k_sys_work_q_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);