diff options
author | John Baldwin <jhb@FreeBSD.org> | 2001-06-06 22:05:48 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2001-06-06 22:05:48 +0000 |
commit | 5beb572b411a07510d8c61fc19369bb5226f83f7 (patch) | |
tree | 70b70b905913c6663fc219f18954844a2951982b /sys | |
parent | 7b77e0fa508999df53f5b87e3ebc63c2ef30b5d0 (diff) | |
download | src-5beb572b411a07510d8c61fc19369bb5226f83f7.tar.gz src-5beb572b411a07510d8c61fc19369bb5226f83f7.zip |
We don't need to hold a lock just to test a flag.
Notes
Notes:
svn path=/head/; revision=77840
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_prof.c | 6 |
1 files changed, 1 insertions, 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 || |