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:
parent
2c10b9fdfa
commit
b62b230461
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128852
@ -353,6 +353,8 @@ stopprofclock(p)
|
|||||||
"stopprof", 0);
|
"stopprof", 0);
|
||||||
p->p_flag &= ~P_STOPPROF;
|
p->p_flag &= ~P_STOPPROF;
|
||||||
}
|
}
|
||||||
|
if ((p->p_flag & P_PROFIL) == 0)
|
||||||
|
return;
|
||||||
mtx_lock_spin(&sched_lock);
|
mtx_lock_spin(&sched_lock);
|
||||||
p->p_flag &= ~P_PROFIL;
|
p->p_flag &= ~P_PROFIL;
|
||||||
if (--profprocs == 0)
|
if (--profprocs == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user