From 503c2ea34d0320db68896221cf0a3185f53ebf66 Mon Sep 17 00:00:00 2001 From: Stephan Uphoff Date: Thu, 19 May 2005 01:08:30 +0000 Subject: [PATCH] Fix a bug that caused preemption to happen for a thread in the same ksegrp with the same priority as the currently running thread. This can cause propagate_priority() to panic. Pointy hat to: ups --- sys/kern/kern_switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 421cc31d7c6a..530305c139b6 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -353,7 +353,7 @@ maybe_preempt_in_ksegrp(struct thread *td) if (running_thread->td_ksegrp != td->td_ksegrp) return; - if (td->td_priority > running_thread->td_priority) + if (td->td_priority >= running_thread->td_priority) return; #ifdef PREEMPTION if (running_thread->td_critnest > 1) @@ -442,7 +442,7 @@ maybe_preempt_in_ksegrp(struct thread *td) } #endif - if (td->td_priority > running_thread->td_priority) + if (td->td_priority >= running_thread->td_priority) return; #ifdef PREEMPTION if (running_thread->td_critnest > 1)