IOCommandGate
Abstract: Single-threaded work-loop client request mechanism.
An IOCommandGate instance is an extremely light way mechanism
that executes an action on the driver's work-loop. 'On the work-loop' is
actually a lie but the work-loop single threaded semantic is maintained for this
event source. Using the work-loop gate rather than execution by the workloop.
The command gate tests for a potential self dead lock by checking if the
runCommand request is made from the work-loop's thread, it doens't check for a
mutual dead lock though where a pair of work loop's dead lock each other.
The IOCommandGate is a lighter weight version of the IOCommandQueue and
should be used in preference. Generally use a command queue whenever you need a
client to submit a request to a work loop. A typical command gate action would
check if the hardware is active, if so it will add the request to a pending
queue internal to the device or the device's family. Otherwise if the hardware
is inactive then this request can be acted upon immediately.
CAUTION: The runAction and runCommand functions can not be called from an interrupt context.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)