From d195860b081b2de18bc49a8a58a9468202964f39 Mon Sep 17 00:00:00 2001 From: deischen Date: Fri, 25 Jul 2014 20:21:02 +0000 Subject: 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. --- sys/kern/kern_thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/kern/kern_thread.c') diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 3f95371..05b07ff 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -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++; } -- cgit v1.1