Lock proc lock before changing p_flag.

This commit is contained in:
David Xu 2003-03-11 03:16:02 +00:00
parent 21e0492ab1
commit 661db6da35
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112078
2 changed files with 4 additions and 0 deletions

View file

@ -610,7 +610,9 @@ kse_create(struct thread *td, struct kse_create_args *uap)
ncpus = virtual_cpu;
/* Easier to just set it than to test and set */
PROC_LOCK(p);
p->p_flag |= P_THREADED;
PROC_UNLOCK(p);
kg = td->td_ksegrp;
if (uap->newgroup) {
/* Have race condition but it is cheap */

View file

@ -610,7 +610,9 @@ kse_create(struct thread *td, struct kse_create_args *uap)
ncpus = virtual_cpu;
/* Easier to just set it than to test and set */
PROC_LOCK(p);
p->p_flag |= P_THREADED;
PROC_UNLOCK(p);
kg = td->td_ksegrp;
if (uap->newgroup) {
/* Have race condition but it is cheap */