On Thursday 29 December 2005 03:57 pm, John Baldwin wrote:
> jhb         2005-12-29 20:57:45 UTC
>
>   FreeBSD src repository
>
>   Modified files:
>     sys/kern             kern_synch.c
>     sys/sys              systm.h
>   Log:
>   Add a new function msleep_spin() which is a slightly stripped down
> version of msleep().  msleep_spin() doesn't support changing the priority
> of the thread while it is asleep nor does it support interruptible sleeps
> (PCATCH) or the PDROP flag.  It does support timeouts however.  It differs
> from msleep() in that the passed in mutex is a spin mutex.  This means one
> can use msleep_spin() and wakeup() with a spin mutex similar to msleep()
> and wakeup() with a regular mutex.  Note that the spin mutex in question
> needs to come before sched_lock and the sleepq locks in lock order.

This is mostly useful for interfacing with code that must work with primary 
interrupt context.  For example, drivers that want to use an INTR_FAST 
handler that defers work to a taskqueue will need to use a taskqueue that 
uses spin locks and this is needed for taskqueue_drain() in that case.  I 
will probably also make use of this to cleanup callout_drain() so that it 
only uses the one spin mutex and loses the extra sleep mutex and the other 
trickery associated with it.

-- 
John Baldwin <[EMAIL PROTECTED]>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to