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
@ -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…
x
Reference in New Issue
Block a user