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
bf4defd302
commit
0dfa816e55
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user