Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2001 23:52:52 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   RE: cvs commit: src/sys/kern kern_exit.c
Message-ID:  <XFMail.010626235252.jhb@FreeBSD.org>
In-Reply-To: <200106270615.f5R6Fij39009@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org> -- 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010626235252.jhb>