Exemple #1
0
        private static void DealQueue()
        {
            while (ThreadQueueContainer <T> .QueueCount > 0)
            {
                T t = ThreadQueueContainer <T> .GetQueue();

                Thread.Sleep(1000 * 10);
                t.state = 1;
                t.SourceManualResetEvent.Set();
            }

            thread.Suspend();
        }
Exemple #2
0
        public static void Add(T d)
        {
            ThreadQueueContainer <T> .AddQueue(d);

            if (thread.ThreadState == ThreadState.Suspended)
            {
                thread.Resume();
            }
            else if (thread.ThreadState == ThreadState.Unstarted || thread.ThreadState == ThreadState.Stopped)
            {
                thread.Start();
            }

            d.SourceManualResetEvent.WaitOne();
        }
Exemple #3
0
 public static T Get(string key)
 {
     return(ThreadQueueContainer <T> .GetDic(key));
 }