EX_WORK_QUEUE ExWorkerQueue[MaximumWorkQueue];
/* Accounting of the total threads and registry hacked threads */
-ULONG ExpCriticalWorkerThreads;
-ULONG ExpDelayedWorkerThreads;
+ULONG ExCriticalWorkerThreads;
+ULONG ExDelayedWorkerThreads;
ULONG ExpAdditionalCriticalWorkerThreads;
ULONG ExpAdditionalDelayedWorkerThreads;
ProcessLoop:
for (;;)
{
- /* Wait for Something to Happen on the Queue */
+ /* Wait for something to happen on the queue */
QueueEntry = KeRemoveQueue(&WorkQueue->WorkerQueue,
WaitMode,
TimeoutPointer);
WorkItem->WorkerRoutine(WorkItem->Parameter);
/* Make sure APCs are not disabled */
- if (Thread->Tcb.SpecialApcDisable)
+ if (Thread->Tcb.CombinedApcDisable != 0)
{
/* We're nice and do it behind your back */
DPRINT1("Warning: Broken Worker Thread: %p %p %p came back "
WorkItem->WorkerRoutine,
WorkItem->Parameter,
WorkItem);
- Thread->Tcb.SpecialApcDisable = 0;
+ ASSERT(Thread->Tcb.CombinedApcDisable == 0);
+ Thread->Tcb.CombinedApcDisable = 0;
}
/* Make sure it returned at right IRQL */
*
* The ExpCreateWorkerThread routine creates a new worker thread for the
* specified queue.
- **
+ *
* @param QueueType
* Type of the queue to use for this thread. Valid values are:
* - DelayedWorkQueue
}
/*++
- * @name ExpCheckDynamicThreadCount
+ * @name ExpDetectWorkerThreadDeadlock
*
- * The ExpCheckDynamicThreadCount routine checks every queue and creates a
- * dynamic thread if the queue seems to be deadlocked.
+ * The ExpDetectWorkerThreadDeadlock routine checks every queue and creates
+ * a dynamic thread if the queue seems to be deadlocked.
*
* @param None
*
* @return None.
*
- * @remarks The algorithm for deciding if a new thread must be created is
- * based on wether the queue has processed no new items in the last
- * second, and new items are still enqueued.
+ * @remarks The algorithm for deciding if a new thread must be created is based
+ * on whether the queue has processed no new items in the last second,
+ * and new items are still enqueued.
*
*--*/
VOID
/*++
* @name ExpCheckDynamicThreadCount
*
- * The ExpCheckDynamicThreadCount routine checks every queue and creates a
- * dynamic thread if the queue requires one.
+ * The ExpCheckDynamicThreadCount routine checks every queue and creates
+ * a dynamic thread if the queue requires one.
*
* @param None
*
ObDereferenceObject(ExpLastWorkerThread);
PsTerminateSystemThread(STATUS_SYSTEM_SHUTDOWN);
}
+
+// #ifdef _WINKD_
+ /*
+ * If WinDBG wants to attach or kill a user-mode process, and/or
+ * page-in an address region, queue a debugger worker thread.
+ */
+ if (ExpDebuggerWork == WinKdWorkerStart)
+ {
+ ExInitializeWorkItem(&ExpDebuggerWorkItem, ExpDebuggerWorker, NULL);
+ ExpDebuggerWork = WinKdWorkerInitialized;
+ ExQueueWorkItem(&ExpDebuggerWorkItem, DelayedWorkQueue);
+ }
+// #endif /* _WINKD_ */
}
}
{
/* Create the thread */
ExpCreateWorkerThread(CriticalWorkQueue, FALSE);
- ExpCriticalWorkerThreads++;
+ ExCriticalWorkerThreads++;
}
/* Create the built-in worker threads for the delayed queue */
{
/* Create the thread */
ExpCreateWorkerThread(DelayedWorkQueue, FALSE);
- ExpDelayedWorkerThreads++;
+ ExDelayedWorkerThreads++;
}
/* Create the built-in worker thread for the hypercritical queue */
}
/* EOF */
-