kernel/swap: Initialize dummy thread's resource pool

The resource pool of the short-lived dummy thread "stub" may be
inherited by other threads created during system initialization. This
commit initializes this resource pool to NULL or the system pool to
ensure that a well-defined resource pool propagates to other threads
that inherit it from the dummy thread.

Fixes #41482.

Signed-off-by: Berend Ozceri <berend@recogni.com>
This commit is contained in:
Berend Ozceri 2022-01-04 16:04:06 -08:00 committed by Anas Nashif
commit b208e5811e

View file

@ -225,6 +225,11 @@ static inline void z_dummy_thread_init(struct k_thread *dummy_thread)
#ifdef CONFIG_USERSPACE
dummy_thread->mem_domain_info.mem_domain = &k_mem_domain_default;
#endif
#if (CONFIG_HEAP_MEM_POOL_SIZE > 0)
k_thread_system_pool_assign(dummy_thread);
#else
dummy_thread->resource_pool = NULL;
#endif
_current_cpu->current = dummy_thread;
}