Hi,

The timeout(9F) manpage says:

"The function called by timeout() must  adhere  to  the  same
    restrictions as a driver soft interrupt handler.

    The function called by timeout() is run in interrupt context
    and must not sleep or call other functions that might sleep."

Does this mean that a function which is called using a timeout, cannot
use mutex_enter() ?

Suppose I have a function A which holds a certain lock, and A calls
function B through timeout. B also requires the lock to be held. What
is the best way to ensure proper operation?

If I put an ASSERT in B for MUTEX_HELD(...), it will likely fail if A
has finished execution by the time the timeout is called.
If I plainly call mutex_enter from B, would this be a recursive mutex
entry? Is it even allowed from a timeout'ed function?

Can timeout be called with a zero-timeout value? In that case I would
like to schedule the other function immediately, but without blocking
the caller.


Thanks, Thomas
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to