From bf1a32206119875dabc12723ad546ec4578e5c49 Mon Sep 17 00:00:00 2001 From: David Xu Date: Tue, 21 Mar 2006 10:05:15 +0000 Subject: [PATCH] Rethink it a bit, if there is a STOP flag, don't bother to resume other threads. --- sys/kern/kern_thread.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 44d5a6b65bd7..11c194ac0a46 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -767,6 +767,8 @@ thread_single(int mode) else remaining = p->p_numthreads - p->p_suspcount; while (remaining != 1) { + if (P_SHOULDSTOP(p) != P_STOPPED_SINGLE) + goto stopme; FOREACH_THREAD_IN_PROC(p, td2) { if (td2 == td) continue; @@ -822,6 +824,7 @@ thread_single(int mode) if (remaining == 1) break; +stopme: /* * Wake us up when everyone else has suspended. * In the mean time we suspend as well.