summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-07-14 08:29:15 +0000
committerjulian <julian@FreeBSD.org>2002-07-14 08:29:15 +0000
commitb443e6894ae5fe91ba5f3ce329e71dc4d995da4e (patch)
treebf7989fe050e8f8cef78bc87c3607f333e4d7035
parent1f90b85e30b1201ea3e5c24561d5f6b88b8facc6 (diff)
downloadFreeBSD-src-b443e6894ae5fe91ba5f3ce329e71dc4d995da4e.zip
FreeBSD-src-b443e6894ae5fe91ba5f3ce329e71dc4d995da4e.tar.gz
part of a greater patch set..
1/ don't need to set td_state to TDS_RUNNING in fork_return. it's already set in choosethread(). 2/ Set a child process state to "normal" as opposed to "new" when we allow it to be put on the run queue. Allows child to receive signals from the parent if the parent runs first and tries to immediatly signal he child. Submitted by: (part 2) Thomas Moestl <tmoestl@gmx.net>
-rw-r--r--sys/kern/kern_fork.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 77481ca..53b3eed 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -729,6 +729,7 @@ again:
p2->p_acflag = AFORK;
if ((flags & RFSTOPPED) == 0) {
mtx_lock_spin(&sched_lock);
+ p2->p_state = PRS_NORMAL;
setrunqueue(td2);
mtx_unlock_spin(&sched_lock);
}
@@ -833,7 +834,6 @@ fork_exit(callout, arg, frame)
td->td_kse->ke_oncpu = PCPU_GET(cpuid);
p->p_state = PRS_NORMAL;
- td->td_state = TDS_RUNNING; /* Already done in switch() on 386. */
/*
* Finish setting up thread glue. We need to initialize
* the thread into a td_critnest=1 state. Some platforms
OpenPOWER on IntegriCloud