From owner-cvs-all Tue Jun 26 23:53: 4 2001 Delivered-To: cvs-all@freebsd.org Received: from server.baldwin.cx (server.baldwin.cx [204.216.28.80]) by hub.freebsd.org (Postfix) with ESMTP id CE0FB37B40B; Tue, 26 Jun 2001 23:52:54 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (tserver.conference.usenix.org [199.103.159.3]) by server.baldwin.cx (8.9.3/8.9.3) with ESMTP id XAA20714; Tue, 26 Jun 2001 23:54:24 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200106270615.f5R6Fij39009@freefall.freebsd.org> Date: Tue, 26 Jun 2001 23:52:52 -0700 (PDT) From: John Baldwin To: John Baldwin Subject: RE: cvs commit: src/sys/kern kern_exit.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 27-Jun-01 John Baldwin wrote: > jhb 2001/06/26 23:15:44 PDT > > Modified files: > sys/kern kern_exit.c > Log: > ... > - When a kthread exits, do a wakeup() on its proc pointers. This can be > used by kernel modules that have kthreads and want to ensure they have > safely exited before completely the MOD_UNLOAD event. For an example of how to use this, see my crash kernel module at http://www.FreeBSD.org/~jhb/crash/ Note that you need to use a lock to protect signaling the kthread that it needs to die and then msleep on that lock when sleep'ing on the kthread proc * to avoid missing the wakeup from the kthread when it dies. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message