We don't need to hold a lock just to test a flag.

This commit is contained in:
John Baldwin 2001-06-06 22:05:48 +00:00
parent 7b77e0fa50
commit 5beb572b41

View File

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