diff options
author | David Xu <davidxu@FreeBSD.org> | 2003-03-11 03:16:02 +0000 |
---|---|---|
committer | David Xu <davidxu@FreeBSD.org> | 2003-03-11 03:16:02 +0000 |
commit | 661db6da3568d8af5e6fc97836ce6fd4be5c4459 (patch) | |
tree | 451c771a435db759f3b7546816429a18e7ce3769 | |
parent | 21e0492ab15c697fc5a7de8108246df82770008f (diff) | |
download | src-661db6da3568d8af5e6fc97836ce6fd4be5c4459.tar.gz src-661db6da3568d8af5e6fc97836ce6fd4be5c4459.zip |
Lock proc lock before changing p_flag.
Notes
Notes:
svn path=/head/; revision=112078
-rw-r--r-- | sys/kern/kern_kse.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_thread.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index 23563723ae29..5a5a96f3ce55 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -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 */ diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 23563723ae29..5a5a96f3ce55 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -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 */ |