From aa2dc0a5d9e7a19420c153cd414fefa8498eab71 Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 29 Jun 2002 17:26:22 +0000 Subject: Part 1 of KSE-III The ability to schedule multiple threads per process (one one cpu) by making ALL system calls optionally asynchronous. to come: ia64 and power-pc patches, patches for gdb, test program (in tools) Reviewed by: Almost everyone who counts (at various times, peter, jhb, matt, alfred, mini, bernd, and a cast of thousands) NOTE: this is still Beta code, and contains lots of debugging stuff. expect slight instability in signals.. --- sys/kern/kern_exec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/kern/kern_exec.c') diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index feaa123..0cd7f27 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -154,12 +154,14 @@ execve(td, uap) PROC_LOCK(p); KASSERT((p->p_flag & P_INEXEC) == 0, ("%s(): process already has P_INEXEC flag", __func__)); + if ((p->p_flag & P_KSES) && thread_single(SNGLE_EXIT)) { + PROC_UNLOCK(p); + mtx_unlock(&Giant); + return (ERESTART); /* Try again later. */ + } + /* If we get here all other threads are dead. */ p->p_flag |= P_INEXEC; PROC_UNLOCK(p); - -/* XXXKSE */ -/* !!!!!!!! we need abort all the other threads of this process before we */ -/* proceed beyond his point! */ /* * Initialize part of the common data -- cgit v1.1