예제 #1
0
 internal override void SubmitQueueForProcessing(ActionQueue queue)
 {
     lock (listLock)
     {
         pendingList.Add(queue);
         listWait.Set();
     }
 }
예제 #2
0
        public IActionQueue CreateQueue(string name = null)
        {
            if (name == null)
            {
                name = Interlocked.Increment(ref queueId).ToString();
            }
            ActionQueue queue = new ActionQueue(name, this);

            lock (mapLock)
            {
                mapQueues.Add(queue.Name, new WeakReference(queue, false));
            }
            return(queue);
        }
예제 #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposed)
     {
         if (disposing)
         {
             lock (mapLock)
             {
                 foreach (WeakReference queueRef in mapQueues.Values)
                 {
                     if (queueRef.IsAlive)
                     {
                         ActionQueue q = (ActionQueue)queueRef.Target;
                         q.DisconnectDispatcher();
                         q.Dispose();
                     }
                 }
                 mapQueues.Clear();
             }
         }
         mapQueues = null;
         disposed  = true;
     }
 }
예제 #4
0
 internal override void SubmitQueueForProcessing(ActionQueue queue)
 {
     ThreadPool.QueueUserWorkItem((object state) => { queue.ProcessQueue(); });
 }
예제 #5
0
 internal abstract void SubmitQueueForProcessing(ActionQueue queue);