From 5beb572b411a07510d8c61fc19369bb5226f83f7 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 6 Jun 2001 22:05:48 +0000 Subject: [PATCH] We don't need to hold a lock just to test a flag. --- sys/kern/subr_prof.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c index d97b4527e7e1..18c2863799cb 100644 --- a/sys/kern/subr_prof.c +++ b/sys/kern/subr_prof.c @@ -444,12 +444,8 @@ addupc_task(p, pc, ticks) u_short v; /* Testing PS_PROFIL may be unnecessary, but is certainly safe. */ - mtx_lock_spin(&sched_lock); - if ((p->p_sflag & PS_PROFIL) == 0 || ticks == 0) { - mtx_unlock_spin(&sched_lock); + if ((p->p_sflag & PS_PROFIL) == 0 || ticks == 0) return; - } - mtx_unlock_spin(&sched_lock); prof = &p->p_stats->p_prof; if (pc < prof->pr_off ||