Fix a race condition which could result in profprocs being decremented

more than once if stopprofclock is called multiple times on the same
process.
This commit is contained in:
Colin Percival 2004-05-03 00:48:11 +00:00
parent 2c10b9fdfa
commit b62b230461
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128852

View File

@ -353,6 +353,8 @@ stopprofclock(p)
"stopprof", 0);
p->p_flag &= ~P_STOPPROF;
}
if ((p->p_flag & P_PROFIL) == 0)
return;
mtx_lock_spin(&sched_lock);
p->p_flag &= ~P_PROFIL;
if (--profprocs == 0)