From owner-svn-src-user@FreeBSD.ORG Thu Nov 20 04:11:22 2008 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 127ED1065672; Thu, 20 Nov 2008 04:11:22 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 047BC8FC1C; Thu, 20 Nov 2008 04:11:22 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAK4BLGD038732; Thu, 20 Nov 2008 04:11:21 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAK4BLIq038730; Thu, 20 Nov 2008 04:11:21 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <200811200411.mAK4BLIq038730@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 20 Nov 2008 04:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185117 - user/lstewart/misc_8.x/share/man/man9 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2008 04:11:22 -0000 Author: lstewart Date: Thu Nov 20 04:11:21 2008 New Revision: 185117 URL: http://svn.freebsd.org/changeset/base/185117 Log: In light of recent discussions regarding the kthread(9)/kproc(9) KPI, clairfy the behaviour of kthread_exit(). Whilst we're here, remove some bogus man page references. Modified: user/lstewart/misc_8.x/share/man/man9/kproc.9 user/lstewart/misc_8.x/share/man/man9/kthread.9 Modified: user/lstewart/misc_8.x/share/man/man9/kproc.9 ============================================================================== --- user/lstewart/misc_8.x/share/man/man9/kproc.9 Thu Nov 20 04:04:22 2008 (r185116) +++ user/lstewart/misc_8.x/share/man/man9/kproc.9 Thu Nov 20 04:11:21 2008 (r185117) @@ -157,11 +157,17 @@ letting the main function return to its The .Fa ecode argument specifies the exit status of the process. -While exiting, the function -.Xr exit1 9 -will initiate a call to +While exiting, the function will call .Xr wakeup 9 -on the process handle. +on the calling process's handle. +If another thread/process needs to wait for the calling process to exit, +.Xr mtx_sleep 9 +can be used in the waiting thread/process with the +.Fa chan +argument set to the exiting process's handle. +This will put the waiting thread/process to sleep until the exiting process +has made its final call to +.Fn kproc_exit . .Pp The .Fn kproc_resume , @@ -332,9 +338,8 @@ parameter. .El .Sh SEE ALSO .Xr rfork 2 , -.Xr exit1 9 , .Xr kthread 9 , -.Xr SYSINIT 9 , +.Xr mtx_sleep 9 , .Xr wakeup 9 .Sh HISTORY The Modified: user/lstewart/misc_8.x/share/man/man9/kthread.9 ============================================================================== --- user/lstewart/misc_8.x/share/man/man9/kthread.9 Thu Nov 20 04:04:22 2008 (r185116) +++ user/lstewart/misc_8.x/share/man/man9/kthread.9 Thu Nov 20 04:11:21 2008 (r185117) @@ -171,7 +171,17 @@ The function is used to terminate kernel threads. It should be called by the main function of the kernel thread rather than letting the main function return to its caller. -.\" XXX "int ecode" argument isn't documented. +While exiting, the function will call +.Xr wakeup 9 +on the calling thread's handle. +If another thread/process needs to wait for the calling thread to exit, +.Xr mtx_sleep 9 +can be used in the waiting thread/process with the +.Fa chan +argument set to the exiting thread's handle. +This will put the waiting thread/process to sleep until the exiting thread +has made its final call to +.Fn kthread_exit . .Pp The .Fn kthread_resume , @@ -290,9 +300,8 @@ parameter. .El .Sh SEE ALSO .Xr rfork 2 , -.Xr exit1 9 , .Xr kproc 9 , -.Xr SYSINIT 9 , +.Xr mtx_sleep 9 , .Xr wakeup 9 .Sh HISTORY The