Date: Mon, 3 Nov 2014 11:29:09 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274038 - head/sys/kern Message-ID: <201411031129.sA3BT9uh043890@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Nov 3 11:29:08 2014 New Revision: 274038 URL: https://svnweb.freebsd.org/changeset/base/274038 Log: Clean up confusing comment. Move it to the place of code which is talked about. Explain where the mentioned trampoline located (usermode), and the fact that attempt to exit last thread is denied in kernel (by delegating the work to usermode). Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_thr.c Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Mon Nov 3 11:21:43 2014 (r274037) +++ head/sys/kern/kern_thr.c Mon Nov 3 11:29:08 2014 (r274038) @@ -317,10 +317,6 @@ sys_thr_exit(struct thread *td, struct t PROC_LOCK(p); - /* - * Shutting down last thread in the proc. This will actually - * call exit() in the trampoline when it returns. - */ if (p->p_numthreads != 1) { racct_sub(p, RACCT_NTHR, 1); LIST_REMOVE(td, td_hash); @@ -331,6 +327,12 @@ sys_thr_exit(struct thread *td, struct t thread_exit(); /* NOTREACHED */ } + + /* + * Ignore attempts to shut down last thread in the proc. This + * will actually call _exit(2) in the usermode trampoline when + * it returns. + */ PROC_UNLOCK(p); rw_wunlock(&tidhash_lock); return (0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411031129.sA3BT9uh043890>