Rethink it a bit, if there is a STOP flag, don't bother to resume other

threads.
This commit is contained in:
David Xu 2006-03-21 10:05:15 +00:00
parent 862aa05f64
commit bf1a322061

View File

@ -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.