summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kern/thread.c b/kern/thread.c
index 6cd56ee9..27c0ea4c 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -1837,8 +1837,13 @@ thread_wakeup(struct thread *thread)
thread_preempt_disable();
cpu_intr_save(&flags);
- /* The returned run queue is locked */
- runq = thread_sched_ops[thread->sched_class].select_runq();
+ if (!thread->pinned)
+ runq = thread_sched_ops[thread->sched_class].select_runq();
+ else {
+ runq = thread->runq;
+ spinlock_lock(&runq->lock);
+ }
+
thread_runq_wakeup(runq, thread);
spinlock_unlock(&runq->lock);
cpu_intr_restore(flags);