107 * @discussion Initialiser for IOCommandGate operates only on newly 'newed'
108 * objects. Shouldn't be used to re-init an existing instance.
109 * @param owner Owner of this, newly created, instance of the IOCommandGate. This argument will be used as the first parameter in the action callout.
123 * @abstract Single thread a command with the target work loop.
124 * @discussion Client function that causes the current action to be called in
125 * a single threaded manner. Beware the work loop's gate is recursive and command
126 * gates can cause direct or indirect re-entrancy. When the executing on a
127 * client's thread runCommand will sleep until the work loop's gate opens for
128 * execution of client actions, the action is single threaded against all other
129 * work loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called.
130 * @param arg0 Parameter for action of command gate, defaults to 0.
131 * @param arg1 Parameter for action of command gate, defaults to 0.
132 * @param arg2 Parameter for action of command gate, defaults to 0.
133 * @param arg3 Parameter for action of command gate, defaults to 0.
134 * @result kIOReturnSuccess if successful. kIOReturnAborted if a disabled command gate is free()ed before being reenabled, kIOReturnNoResources if no action available.
140 * @abstract Single thread a call to an action with the target work loop.
141 * @discussion Client function that causes the given action to be called in
142 * a single threaded manner. Beware the work loop's gate is recursive and command
143 * gates can cause direct or indirect re-entrancy. When the executing on a
144 * client's thread runAction will sleep until the work loop's gate opens for
145 * execution of client actions, the action is single threaded against all other
146 * work loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called.
147 * @param action Pointer to function to be executed in the context of the work loop.
148 * @param arg0 Parameter for action parameter, defaults to 0.
149 * @param arg1 Parameter for action parameter, defaults to 0.
150 * @param arg2 Parameter for action parameter, defaults to 0.
151 * @param arg3 Parameter for action parameter, defaults to 0.
152 * @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.
160 * @abstract Single thread a call to an action with the target work loop.
161 * @discussion Client function that causes the given action to be called in
162 * a single threaded manner. Beware the work loop's gate is recursive and command
163 * gates can cause direct or indirect re-entrancy. When the executing on a
164 * client's thread runAction will sleep until the work loop's gate opens for
165 * execution of client actions, the action is single threaded against all other
166 * work loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called.
167 * @param action Block to be executed in the context of the work loop.
168 * @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.
174 * @abstract Single thread a command with the target work loop.
175 * @discussion Client function that causes the current action to be called in
176 * a single threaded manner. When the executing on a client's thread attemptCommand will fail if the work loop's gate is closed.
177 * @param arg0 Parameter for action of command gate, defaults to 0.
178 * @param arg1 Parameter for action of command gate, defaults to 0.
179 * @param arg2 Parameter for action of command gate, defaults to 0.
180 * @param arg3 Parameter for action of command gate, defaults to 0.
181 * @result kIOReturnSuccess if successful. kIOReturnNotPermitted if this event source is currently disabled, kIOReturnNoResources if no action available, kIOReturnCannotLock if lock attempt fails.
187 * @abstract Single thread a call to an action with the target work loop.
188 * @discussion Client function that causes the given action to be called in
189 * a single threaded manner. Beware the work loop's gate is recursive and command
190 * gates can cause direct or indirect re-entrancy. When the executing on a
191 * client's thread attemptCommand will fail if the work loop's gate is closed.
192 * @param action Pointer to function to be executed in context of the work loop.
193 * @param arg0 Parameter for action parameter, defaults to 0.
194 * @param arg1 Parameter for action parameter, defaults to 0.
195 * @param arg2 Parameter for action parameter, defaults to 0.
196 * @param arg3 Parameter for action parameter, defaults to 0.
197 * @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnNotPermitted if this event source is currently disabled, kIOReturnCannotLock if lock attempt fails.
205 * @abstract Put a thread that is currently holding the command gate to sleep.
206 * @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. If the thread does not hold the gate, panic.
208 * @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.
221 * @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. */
225 * @abstract Enable command gate, this will unblock any blocked Commands and Actions.
226 * @discussion Enable the command gate. The attemptAction/attemptCommand calls will now be enabled and can succeeed. Stalled runCommand/runAction calls will be woken up. */
230 * @abstract Put a thread that is currently holding the command gate to sleep.
231 * @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. If the thread does not hold the gate, panic.
233 * @param deadline Clock deadline to timeout the sleep.
234 * @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.