Microsoft.Ccr.Core.DispatcherQueue.TryDequeue C# (CSharp) Method

TryDequeue() public method

public TryDequeue ( ITask &task ) : bool
task ITask
return bool
        public virtual bool TryDequeue(out ITask task)
        {
            if (!CheckDispose () || suspended) {
                task = null;
                return false;
            }
            lock (_lock) {
                if (queue.Count == 0) {
                    task = null;
                    return false;
                }
                task = queue.First.Value;
                queue.RemoveFirst ();
                if (waitingProducers > 0)
                    Monitor.Pulse (_lock);
                return true;
            }
        }