From c67ddc21e7bbde04a957b369793860f270c721c2 Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Thu, 15 Nov 2007 06:35:26 +0000 Subject: [PATCH] This time REALLY copy the name from the proc to the thread as a default. --- sys/kern/kern_kse.c | 1 + sys/kern/kern_thr.c | 1 + sys/kern/kern_thread.c | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index b80c0078c097..a955fba4dcd1 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -1045,6 +1045,7 @@ thread_schedule_upcall(struct thread *td, struct kse_upcall *ku) __rangeof(struct thread, td_startcopy, td_endcopy)); sched_fork_thread(td, td2); thread_link(td2, ku->ku_proc); + bcopy(ku->ku_comm, td2->td_name, sizeof(td2->td_name)); /* inherit parts of blocked thread's context as a good template */ cpu_set_upcall(td2, td); /* Let the new thread become owner of the upcall */ diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 6bf0dedfe425..25bf8d1d5ef7 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -231,6 +231,7 @@ create_thread(struct thread *td, mcontext_t *ctx, newtd->td_sigmask = td->td_sigmask; PROC_SLOCK(p); thread_link(newtd, p); + bcopy(p->p_comm, newtd->td_name, sizeof(newtd->td_name)); thread_lock(td); /* let the scheduler know about these things. */ sched_fork_thread(td, newtd); diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 7fdfa20c443c..7ff40eb3cb62 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -232,7 +232,6 @@ proc_linkup(struct proc *p, struct thread *td) /* XXX p_ksi may be null if ksiginfo zone is not ready */ p->p_ksi->ksi_flags = KSI_EXT | KSI_INS; } - bcopy(p->p_comm, td->td_name, sizeof(td->td_name)); LIST_INIT(&p->p_mqnotifier); p->p_numthreads = 0; thread_link(td, p);