#include <IOKit/IOTimeStamp.h>
#include <IOKit/IOKitDebug.h>
#include <libkern/OSDebug.h>
+#include <kern/thread.h>
#define super OSObject
workToDo = false;
}
- if (!reserved) {
- reserved = IONew(ExpansionData, 1);
- reserved->options = 0;
- }
-
IOStatisticsRegisterCounter();
if ( controlG == NULL ) {
return false;
}
+ (void) thread_set_tag(workThread, THREAD_TAG_IOWORKLOOP);
return true;
}
// Either way clean up all of our resources and return.
if (controlG) {
+ controlG->workLoop = 0;
controlG->release();
controlG = 0;
}
case mRemoveEvent:
if (inEvent->getWorkLoop()) {
+ IOStatisticsDetachEventSource();
+
if (eventSourcePerformsWork(inEvent)) {
if (eventChain == inEvent)
eventChain = inEvent->getNext();
else {
- IOEventSource *event, *next;
+ IOEventSource *event, *next = 0;
event = eventChain;
- while ((next = event->getNext()) && next != inEvent)
+ if (event) while ((next = event->getNext()) && (next != inEvent))
event = next;
if (!next) {
if (passiveEventChain == inEvent)
passiveEventChain = inEvent->getNext();
else {
- IOEventSource *event, *next;
+ IOEventSource *event, *next = 0;
event = passiveEventChain;
- while ((next = event->getNext()) && next != inEvent)
+ if (event) while ((next = event->getNext()) && (next != inEvent))
event = next;
if (!next) {
inEvent->setNext(0);
inEvent->release();
SETP(&fFlags, kLoopRestart);
- IOStatisticsDetachEventSource();
}
break;