diff options
author | jhb <jhb@FreeBSD.org> | 2001-06-06 22:05:48 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-06-06 22:05:48 +0000 |
commit | df7d2486bc3728e9ce027e6eb853576a75e13f2e (patch) | |
tree | f8efe1dff3d8b8003827d1ac8ad4b1442a13fdef /sys | |
parent | 736ceb47561d46a525c9e59e2544571a4271b191 (diff) | |
download | FreeBSD-src-df7d2486bc3728e9ce027e6eb853576a75e13f2e.zip FreeBSD-src-df7d2486bc3728e9ce027e6eb853576a75e13f2e.tar.gz |
We don't need to hold a lock just to test a flag.
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 d97b452..18c2863 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 || |