120 @abstract Single thread a command with the target work-loop.
121 @discussion Client function that causes the current action to be called in
122a single threaded manner. Beware the work-loop's gate is recursive and command
123gates can cause direct or indirect re-entrancy. When the executing on a
124client's thread runCommand will sleep until the work-loop's gate opens for
125execution of client actions, the action is single threaded against all other
126work-loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called.
127 @param arg0 Parameter for action of command gate, defaults to 0.
128 @param arg1 Parameter for action of command gate, defaults to 0.
129 @param arg2 Parameter for action of command gate, defaults to 0.
130 @param arg3 Parameter for action of command gate, defaults to 0.
131 @result kIOReturnSuccess if successful. kIOReturnAborted if a disabled command gate is free()ed before being reenabled, kIOReturnNoResources if no action available.
137 @abstract Single thread a call to an action with the target work-loop.
138 @discussion Client function that causes the given action to be called in
139a single threaded manner. Beware the work-loop's gate is recursive and command
140gates can cause direct or indirect re-entrancy. When the executing on a
141client's thread runAction will sleep until the work-loop's gate opens for
142execution of client actions, the action is single threaded against all other
143work-loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called.
144 @param action Pointer to function to be executed in work-loop context.
145 @param arg0 Parameter for action parameter, defaults to 0.
146 @param arg1 Parameter for action parameter, defaults to 0.
147 @param arg2 Parameter for action parameter, defaults to 0.
148 @param arg3 Parameter for action parameter, defaults to 0.
149 @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnAborted if a disabled command gate is free()ed before being reenabled.
156 @abstract Single thread a command with the target work-loop.
157 @discussion Client function that causes the current action to be called in
158a single threaded manner. When the executing on a client's thread attemptCommand will fail if the work-loop's gate is closed.
159 @param arg0 Parameter for action of command gate, defaults to 0.
160 @param arg1 Parameter for action of command gate, defaults to 0.
161 @param arg2 Parameter for action of command gate, defaults to 0.
162 @param arg3 Parameter for action of command gate, defaults to 0.
163 @result kIOReturnSuccess if successful. kIOReturnNotPermitted if this event source is currently disabled, kIOReturnNoResources if no action available, kIOReturnCannotLock if lock attempt fails.
169 @abstract Single thread a call to an action with the target work-loop.
170 @discussion Client function that causes the given action to be called in
171a single threaded manner. Beware the work-loop's gate is recursive and command
172gates can cause direct or indirect re-entrancy. When the executing on a
173client's thread attemptCommand will fail if the work-loop's gate is closed.
174 @param action Pointer to function to be executed in work-loop context.
175 @param arg0 Parameter for action parameter, defaults to 0.
176 @param arg1 Parameter for action parameter, defaults to 0.
177 @param arg2 Parameter for action parameter, defaults to 0.
178 @param arg3 Parameter for action parameter, defaults to 0.
179 @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnNotPermitted if this event source is currently disabled, kIOReturnCannotLock if lock attempt fails.
187 @abstract Put a thread that is currently holding the command gate to sleep.
188 @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.
190 @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.
191 @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. */
203 @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. */
207 @abstract Enable command gate, this will unblock any blocked Commands and Actions.
208 @discussion Enable the command gate. The attemptAction/attemptCommand calls will now be enabled and can succeeed. Stalled runCommand/runAction calls will be woken up. */
212 @abstract Put a thread that is currently holding the command gate to sleep.
213 @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.
215 @param deadline Clock deadline to timeout the sleep.
216 @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.
217 @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. */