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: Yasushi SHOJI <y-shoji@ispace-inc.com>
This commit is contained in:
parent
612a608e61
commit
20d072465d
1 changed files with 1 additions and 1 deletions
|
@ -555,7 +555,7 @@ void k_sched_unlock(void)
|
|||
|
||||
LOCKED(&sched_spinlock) {
|
||||
++_current->base.sched_locked;
|
||||
update_cache(1);
|
||||
update_cache(0);
|
||||
}
|
||||
|
||||
K_DEBUG("scheduler unlocked (%p:%d)\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue