Esempio n. 1
0
 internal override WorkItem GetNext()
 {
     CallQueued.WaitOne();
     lock (m_HighPriorityItemQueue)
     {
         if (m_HighPriorityItemQueue.Count >= 1)
         {
             return(m_HighPriorityItemQueue.Dequeue());
         }
     }
     lock (m_NormalPriorityItemQueue)
     {
         if (m_NormalPriorityItemQueue.Count >= 1)
         {
             return(m_NormalPriorityItemQueue.Dequeue());
         }
     }
     lock (m_LowPriorityItemQueue)
     {
         if (m_LowPriorityItemQueue.Count >= 1)
         {
             return(m_LowPriorityItemQueue.Dequeue());
         }
     }
     return(null);
 }
Esempio n. 2
0
 internal virtual WorkItem GetNext()
 {
     CallQueued.WaitOne();
     lock (m_WorkItemQueue)
     {
         if (m_WorkItemQueue.Count == 0)
         {
             return(null);
         }
         return(m_WorkItemQueue.Dequeue());
     }
 }