summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-02-22 00:43:40 +0100
committerRichard Braun <rbraun@sceen.net>2018-02-22 00:43:40 +0100
commite8265363384bc3f8e6bb31466a3590ce27811efa (patch)
treeb26cc2a341751deba5f801b6c16685a0d5f98fc0 /kern/thread.c
parent3dab066560158cde19ec8c7df3515a01bb04b746 (diff)
kern/spinlock: add ownership tracking as a debugging feature
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);
}