124 @abstract Single thread a command with the target work-loop.
125 @discussion Client function that causes the current action to be called in
126a single threaded manner. Beware the work-loop's gate is recursive and command
127gates can cause direct or indirect re-entrancy. When the executing on a
128client's thread runCommand will sleep until the work-loop's gate opens for
129execution of client actions, the action is single threaded against all other
130work-loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called.
131 @param arg0 Parameter for action of command gate, defaults to 0.
132 @param arg1 Parameter for action of command gate, defaults to 0.
133 @param arg2 Parameter for action of command gate, defaults to 0.
134 @param arg3 Parameter for action of command gate, defaults to 0.
135 @result kIOReturnSuccess if successful. kIOReturnAborted if a disabled command gate is free()ed before being reenabled, kIOReturnNoResources if no action available.
141 @abstract Single thread a call to an action with the target work-loop.
142 @discussion Client function that causes the given action to be called in
143a single threaded manner. Beware the work-loop's gate is recursive and command
144gates can cause direct or indirect re-entrancy. When the executing on a
145client's thread runAction will sleep until the work-loop's gate opens for
146execution of client actions, the action is single threaded against all other
147work-loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called.
148 @param action Pointer to function to be executed in work-loop context.
149 @param arg0 Parameter for action parameter, defaults to 0.
150 @param arg1 Parameter for action parameter, defaults to 0.
151 @param arg2 Parameter for action parameter, defaults to 0.
152 @param arg3 Parameter for action parameter, defaults to 0.
153 @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnAborted if a disabled command gate is free()ed before being reenabled.
160 @abstract Single thread a command with the target work-loop.
161 @discussion Client function that causes the current action to be called in
162a single threaded manner. When the executing on a client's thread attemptCommand will fail if the work-loop's gate is closed.
163 @param arg0 Parameter for action of command gate, defaults to 0.
164 @param arg1 Parameter for action of command gate, defaults to 0.
165 @param arg2 Parameter for action of command gate, defaults to 0.
166 @param arg3 Parameter for action of command gate, defaults to 0.
167 @result kIOReturnSuccess if successful. kIOReturnNotPermitted if this event source is currently disabled, kIOReturnNoResources if no action available, kIOReturnCannotLock if lock attempt fails.
173 @abstract Single thread a call to an action with the target work-loop.
174 @discussion Client function that causes the given action to be called in
175a single threaded manner. Beware the work-loop's gate is recursive and command
176gates can cause direct or indirect re-entrancy. When the executing on a
177client's thread attemptCommand will fail if the work-loop's gate is closed.
178 @param action Pointer to function to be executed in work-loop context.
179 @param arg0 Parameter for action parameter, defaults to 0.
180 @param arg1 Parameter for action parameter, defaults to 0.
181 @param arg2 Parameter for action parameter, defaults to 0.
182 @param arg3 Parameter for action parameter, defaults to 0.
183 @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnNotPermitted if this event source is currently disabled, kIOReturnCannotLock if lock attempt fails.
191 @abstract Put a thread that is currently holding the command gate to sleep.
192 @discussion Put a thread to sleep waiting for an event but release the gate first. If the event occurs then the commandGate is closed before the function returns.
194 @param interruptible THREAD_UNINT, THREAD_INTERRUPTIBLE or THREAD_ABORTSAFE. THREAD_UNINT specifies that the sleep cannot be interrupted by a signal. THREAD_INTERRUPTIBLE specifies that the sleep may be interrupted by a "kill -9" signal. THREAD_ABORTSAFE (the default value) specifies that the sleep may be interrupted by any user signal.
195 @result THREAD_AWAKENED - normal wakeup, THREAD_TIMED_OUT - timeout expired, THREAD_INTERRUPTED - interrupted, THREAD_RESTART - restart operation entirely, kIOReturnNotPermitted if the calling thread does not hold the command gate. */
207 @discussion When a command gate is disabled all future calls to runAction and runCommand will stall until the gate is enable()d later. This can be used to block client threads when a system sleep is requested. The IOWorkLoop thread itself will never stall, even when making runAction/runCommand calls. This call must be made from a gated context, to clear potential race conditions. */
211 @abstract Enable command gate, this will unblock any blocked Commands and Actions.
212 @discussion Enable the command gate. The attemptAction/attemptCommand calls will now be enabled and can succeeed. Stalled runCommand/runAction calls will be woken up. */
216 @abstract Put a thread that is currently holding the command gate to sleep.
217 @discussion Put a thread to sleep waiting for an event but release the gate first. If the event occurs or timeout occurs then the commandGate is closed before the function returns.
219 @param deadline Clock deadline to timeout the sleep.
220 @param interruptible THREAD_UNINT, THREAD_INTERRUPTIBLE or THREAD_ABORTSAFE. THREAD_UNINT specifies that the sleep cannot be interrupted by a signal. THREAD_INTERRUPTIBLE specifies that the sleep may be interrupted by a "kill -9" signal. THREAD_ABORTSAFE specifies that the sleep may be interrupted by any user signal.
221 @result THREAD_AWAKENED - normal wakeup, THREAD_TIMED_OUT - timeout expired, THREAD_INTERRUPTED - interrupted, THREAD_RESTART - restart operation entirely, kIOReturnNotPermitted if the calling thread does not hold the command gate. */