summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kern/thread.c b/kern/thread.c
index 926ca744..5ba51b02 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -640,6 +640,7 @@ thread_runq_schedule(struct thread_runq *runq)
if (likely(prev != next)) {
rcu_report_context_switch(thread_rcu_reader(prev));
+ spinlock_transfer_owner(&runq->lock, next);
/*
* That's where the true context switch occurs. The next thread must
@@ -2619,6 +2620,7 @@ thread_run_scheduler(void)
spinlock_lock(&runq->lock);
thread = thread_runq_get_next(thread_runq_local());
+ spinlock_transfer_owner(&runq->lock, thread);
tcb_load(&thread->tcb);
}