From e8265363384bc3f8e6bb31466a3590ce27811efa Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Thu, 22 Feb 2018 00:43:40 +0100 Subject: kern/spinlock: add ownership tracking as a debugging feature --- kern/thread.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kern/thread.c') 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); } -- cgit v1.2.3