From ad22735e3f427b9771996664a5a558d84fbc6cf2 Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Wed, 10 Jul 2002 06:40:22 +0000 Subject: [PATCH] Don't slow every syscall and trap by doing locks and stuff if the 'stop' bits are not set. This is a temporary thing.. I think this code probably needs to be rewritten anyhow. --- sys/kern/subr_trap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 027aa9c7f34b..85edeedb8077 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -106,10 +106,14 @@ userret(td, frame, oticks) /* * We need to check to see if we have to exit or wait due to a * single threading requirement or some other STOP condition. + * Don't bother doing all the work if the stop bits are not set + * at this time.. If we miss it, we miss it.. no big deal. */ - PROC_LOCK(p); - thread_suspend_check(0); /* Can suspend or kill */ - PROC_UNLOCK(p); + if (P_SHOULDSTOP(p)) { + PROC_LOCK(p); + thread_suspend_check(0); /* Can suspend or kill */ + PROC_UNLOCK(p); + } /* * DO special thread processing, e.g. upcall tweaking and such