45 @discussion An IOWorkLoop is a thread of control that is intended to be used to provide single threaded access to hardware. This class has no knowledge of the nature and type of the events that it marshals and forwards. When an device driver sucessfully starts, See $link IOService::start it is expected to create the event sources it will need to receive events from. Then a work loop is initialised and the events are added to the work loop for monitoring. In general this set up will be automated by the family superclass of the specific device.
47 The thread main method walks the event source linked list and messages each one requesting a work check. At this point each event source is expected to notify their registered owner that the event has occured. After each event has been walked and they indicate that another loop isn't required by the 'more' flag being false the thread will go to sleep on a signaling semaphore.
132 @discussion Mandatory free of the object independent of the current retain count. If the work loop is running this method will not return until the thread has succefully terminated. Each event source in the chain will be released and the working semaphore will be destroyed.
134 If the client has some outstanding requests on an event they will never be informed of completion. If an external thread is blocked on any of the event sources they will be awoken with a KERN_INTERUPTED status. */
138 @discussion Work loop threads main function. This function consists of 3 loops: the outermost loop is the semaphore clear and wait loop, the middle loop terminates when there is no more work and the inside loop walks the event list calling the $link checkForWork method in each event source. If an event source has more work to do then it can set the more flag and the middle loop will repeat. When no more work is outstanding the outermost will sleep until and event is signaled or the least wakeupTime whichever occurs first. If the event source does not require the semaphore wait to time out it must set the provided wakeupTime parameter to zero. */
150 Initialises an instance of the workloop. This method creates and initialses the signaling semaphore and forks the thread that will continue executing.
151 @result true if initialised successfully, false otherwise. */
170 @discussion Add an event source to be monitored by the work loop. This function does not return until the work loop has acknowledged the arrival of the new event source. When a new event has been added the threadMain will always restart it's loop and check all outstanding events. The event source is retained by the work loop
171 @param newEvent Pointer to $link IOEventSource subclass to add.
176 @discussion Remove an event source from the work loop. This function does not return until the work loop has acknowledged the removal of the event source. When an event has been removed the threadMain will always restart it's loop and check all outstanding events. The event source will be released before return.
177 @param toRemove Pointer to $link IOEventSource subclass to remove.
178 @result kIOReturnSuccess if successful, kIOReturnBadArgument if toRemove couldn't be found. */
192 @abstract Call enable() in all interrupt event sources
193 @discussion For all event sources, ES, for which IODynamicCast(IOInterruptEventSource, ES) is valid, in $link eventChain call enable() function. See $link IOEventSource::enable() */
197 @abstract Call disable() in all interrupt event sources
198 @discussion For all event sources, ES, for which IODynamicCast(IOInterruptEventSource, ES) is valid, in $link eventChain call disable() function. See $link IOEventSource::disable() */