kernel: sched: assert when k_sleep invoked from interrupt context
Fix a gap where k_sleep(K_FOREVER) could execute a code path that would not verify that the call was not from interrupt context. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
218b45b749
commit
8162e586e3
1 changed files with 2 additions and 0 deletions
|
@ -1020,6 +1020,8 @@ s32_t z_impl_k_sleep(int ms)
|
|||
{
|
||||
s32_t ticks;
|
||||
|
||||
__ASSERT(!arch_is_in_isr(), "");
|
||||
|
||||
if (ms == K_FOREVER) {
|
||||
k_thread_suspend(_current);
|
||||
return K_FOREVER;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue