Microsoft.Ccr.Core.Dispatcher.Notify C# (CSharp) Method

Notify() private method

private Notify ( DispatcherQueue queue ) : void
queue DispatcherQueue
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);
            }
        }