Insert new threads at the end of the thread list in the process

instead of at the beginning.  This allows an intra process signal
to be sent to the oldest thread with the signal unmasked - which,
if it still exists, is the main thread.  This mimics behavior
found in Linux and Solaris.
This commit is contained in:
Daniel Eischen 2014-07-25 20:21:02 +00:00
parent afd5e8ba88
commit 66d8df9dfc

View File

@ -546,7 +546,7 @@ thread_link(struct thread *td, struct proc *p)
LIST_INIT(&td->td_lprof[1]);
sigqueue_init(&td->td_sigqueue, p);
callout_init(&td->td_slpcallout, CALLOUT_MPSAFE);
TAILQ_INSERT_HEAD(&p->p_threads, td, td_plist);
TAILQ_INSERT_TAIL(&p->p_threads, td, td_plist);
p->p_numthreads++;
}