summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-04-01 01:26:20 +0000
committerjeff <jeff@FreeBSD.org>2003-04-01 01:26:20 +0000
commit1b4d7b91cef2a324650912a6c4a57c1247f72de9 (patch)
treefe9429d1c952f94fe7724a5e8d93774c365108da /sys/kern/kern_exec.c
parentddd831445867d7b38b022286ecc4d99f0bcbca48 (diff)
downloadFreeBSD-src-1b4d7b91cef2a324650912a6c4a57c1247f72de9.zip
FreeBSD-src-1b4d7b91cef2a324650912a6c4a57c1247f72de9.tar.gz
- Borrow the KSE single threading code for exec and exit. We use the check
if (p->p_numthreads > 1) and not a flag because action is only necessary if there are other threads. The rest of the system has no need to identify thr threaded processes. - In kern_thread.c use thr_exit1() instead of thread_exit() if P_THREADED is not set.
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index a8c668b..7f5c819 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -189,7 +189,7 @@ kern_execve(td, fname, argv, envv, mac_p)
PROC_LOCK(p);
KASSERT((p->p_flag & P_INEXEC) == 0,
("%s(): process already has P_INEXEC flag", __func__));
- if (p->p_flag & P_THREADED) {
+ if (p->p_flag & P_THREADED || p->p_numthreads > 1) {
if (thread_single(SINGLE_EXIT)) {
PROC_UNLOCK(p);
return (ERESTART); /* Try again later. */
OpenPOWER on IntegriCloud