private Notify ( |
||
queue | ||
return | void |
internal void Notify(DispatcherQueue queue)
{
int curPending = Interlocked.Increment (ref pendingTasks);
if (workers.Count == 0 || (curPending > 0 && workers.Count < maxThreads)) {
SpawnWorker ();
return;
}
lock (_lock) {
if (Thread.VolatileRead (ref pendingWorkers) != 0)
Monitor.Pulse (_lock);
}
}