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>
This commit is contained in:
julian 2002-07-14 08:29:15 +00:00
parent 1f90b85e30
commit b443e6894a

View File

@ -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