Skip to content
Commit 20d07246 authored by Yasushi SHOJI's avatar Yasushi SHOJI Committed by Carles Cufí
Browse files

kernel: sched: Do not force preempt when k_sched_unlock()



The scheduler lock is a nestable lock.  Unlocking a nested,
still-having, lock shouldn't preempt the current thread.

	k_sched_lock();
	k_sched_lock();
	k_sched_unlock();  /* <--- this shouldn't be a scheduling point */
	k_sched_unlock();  /* <--- this is a scheduling point */

This commit changes the preempt_ok argument from 1 to 0.  This let
should_preempt() check whether it should preempt at the point or not.

This fixes #17869.

Signed-off-by: default avatarYasushi SHOJI <y-shoji@ispace-inc.com>
parent 612a608e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment