Date: Wed, 6 Oct 2004 00:40:41 +0000 (UTC) From: David Xu <davidxu@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/sys proc.h src/sys/kern kern_exec.c kern_thread.c Message-ID: <200410060040.i960efqj089441@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
davidxu 2004-10-06 00:40:41 UTC FreeBSD src repository Modified files: sys/sys proc.h sys/kern kern_exec.c kern_thread.c Log: In original kern_execve() code, at the start of the function, it forces all other threads to suicide, problem is execve() could be failed, and a failed execve() would change threaded process to unthreaded, this side effect is unexpected. The new code introduces a new single threading mode SINGLE_BOUNDARY, in the mode, all threads should suspend themself at user boundary except the singler. we can not use SINGLE_NO_EXIT because we want to start from a clean state if execve() is successful, suspending other threads at unknown point and later resuming them from there and forcing them to exit at user boundary may cause the process to start from a dirty state. If execve() is successful, current thread upgrades to SINGLE_EXIT mode and forces other threads to suicide at user boundary, otherwise, other threads will be resumed and their interrupted syscall will be restarted. Reviewed by: julian Revision Changes Path 1.254 +46 -12 src/sys/kern/kern_exec.c 1.203 +60 -23 src/sys/kern/kern_thread.c 1.409 +5 -3 src/sys/sys/proc.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410060040.i960efqj089441>