protected:
virtual bool checkForWork();
Result: Returns a pointer to the new command gate if sucessful, 0 otherwise.public:
static IOCommandGate *commandGate(OSObject *owner, Action action = 0);
public:
virtual bool init(OSObject *owner, Action action = 0);
Initialiser for IOCommandGate operates only on newly 'newed' objects. Shouldn't be used to re-init an existing instance.
Result: True if inherited classes initialise successfully.
Name Description owner Owner of this, newly created, instance of the IOCommandGate. This argument will be used as the first parameter in the action callout. action Pointer to a C function that is called whenever a client of the IOCommandGate calls runCommand. NB Can be a C++ member function but caller must cast the member function to $link IOCommandGate::Action and they will get a compiler warning. Defaults to zero, see $link IOEventSource::setAction.
public:
virtual IOReturn runAction(Action action, void *arg0 = 0, void *arg1 = 0, void *arg2 = 0, void *arg3 = 0);
Client function that causes the given action to be called in a single threaded manner. Beware the work-loop's gate is recursive and command gates can cause direct or indirect re-entrancy. When the executing on a client's thread runCommand will sleep until the work-loop's gate opens for execution of client actions, the action is single threaded against all other work-loop event sources.
Result: kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnNoResources if no action available.
Name Description action Pointer to function to be executed in work-loop context. arg0 Parameter for action of command gate, defaults to 0. arg1 Parameter for action of command gate, defaults to 0. arg2 Parameter for action of command gate, defaults to 0. arg3 Parameter for action of command gate, defaults to 0.
public:
virtual IOReturn runCommand(void *arg0 = 0, void *arg1 = 0, void *arg2 = 0, void *arg3 = 0);
Client function that causes the current action to be called in a single threaded manner. Beware the work-loop's gate is recursive and command gates can cause direct or indirect re-entrancy. When the executing on a client's thread runCommand will sleep until the work-loop's gate opens for execution of client actions, the action is single threaded against all other work-loop event sources.
Result: kIOReturnSuccess if successful. kIOReturnNotPermitted if this event source is currently disabled, kIOReturnNoResources if no action available.
Name Description arg0 Parameter for action of command gate, defaults to 0. arg1 Parameter for action of command gate, defaults to 0. arg2 Parameter for action of command gate, defaults to 0. arg3 Parameter for action of command gate, defaults to 0.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)