We don't need to hold a lock just to test a flag.
This commit is contained in:
parent
7b77e0fa50
commit
5beb572b41
@ -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 ||
|
||||
|
Loading…
Reference in New Issue
Block a user