Esempio n. 1
0
 internal override void SubmitQueueForProcessing(ActionQueue queue)
 {
     lock (listLock)
     {
         pendingList.Add(queue);
         listWait.Set();
     }
 }
        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);
        }
 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;
     }
 }
Esempio n. 4
0
 internal override void SubmitQueueForProcessing(ActionQueue queue)
 {
     ThreadPool.QueueUserWorkItem((object state) => { queue.ProcessQueue(); });
 }
 internal abstract void SubmitQueueForProcessing(ActionQueue queue);