kernel: Add timeout_lock usage notes

Adds a note about the timeout_lock to aid future developers
in following the rules to help prevent deadlocks involving the
timeout and scheduler spinlocks.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
Peter Mitsis 2025-01-09 13:50:38 -08:00 committed by Benjamin Cabé
commit 90e2498982

View file

@ -16,6 +16,10 @@ static uint64_t curr_tick;
static sys_dlist_t timeout_list = SYS_DLIST_STATIC_INIT(&timeout_list);
/*
* The timeout code shall take no locks other than its own (timeout_lock), nor
* shall it call any other subsystem while holding this lock.
*/
static struct k_spinlock timeout_lock;
#define MAX_WAIT (IS_ENABLED(CONFIG_SYSTEM_CLOCK_SLOPPY_IDLE) \