- @abstract Single thread a call to an action with the target work-loop.
- @discussion 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.
- @param action Pointer to function to be executed in work-loop context.
- @param arg0 Parameter for action parameter, defaults to 0.
- @param arg1 Parameter for action parameter, defaults to 0.
- @param arg2 Parameter for action parameter, defaults to 0.
- @param arg3 Parameter for action parameter, defaults to 0.
- @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnNotPermitted if this event source is currently disabled.
-*/
- virtual IOReturn runAction(Action action,
- void *arg0 = 0, void *arg1 = 0,
- void *arg2 = 0, void *arg3 = 0);
+ * @abstract Single thread a call to an action with the target work loop.
+ * @discussion 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 runAction 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. If the command is disabled the attempt to run a command will be stalled until enable is called.
+ * @param action Pointer to function to be executed in the context of the work loop.
+ * @param arg0 Parameter for action parameter, defaults to 0.
+ * @param arg1 Parameter for action parameter, defaults to 0.
+ * @param arg2 Parameter for action parameter, defaults to 0.
+ * @param arg3 Parameter for action parameter, defaults to 0.
+ * @result The return value of action if it was called, kIOReturnBadArgument if action is not defined, kIOReturnAborted if a disabled command gate is free()ed before being reenabled.
+ */
+ virtual IOReturn runAction(Action action,
+ void *arg0 = NULL, void *arg1 = NULL,
+ void *arg2 = NULL, void *arg3 = NULL);
+
+#ifdef __BLOCKS__
+/*! @function runActionBlock
+ * @abstract Single thread a call to an action with the target work loop.
+ * @discussion 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 runAction 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. If the command is disabled the attempt to run a command will be stalled until enable is called.
+ * @param action Block to be executed in the context of the work loop.
+ * @result The return value of action if it was called, kIOReturnBadArgument if action is not defined, kIOReturnAborted if a disabled command gate is free()ed before being reenabled.
+ */
+ IOReturn runActionBlock(ActionBlock action);
+#endif /* __BLOCKS__ */