Apache.NMS.ActiveMQ.Threads.ThreadPoolExecutor.Shutdown C# (CSharp) Метод

Shutdown() публичный Метод

public Shutdown ( ) : void
Результат void
        public void Shutdown()
        {
            if(!this.closed)
            {
                syncRoot.WaitOne();

                if(!this.closed)
                {
                    this.closing = true;
                    this.workQueue.Clear();

                    if(this.running)
                    {
                        syncRoot.ReleaseMutex();
                        this.executionComplete.WaitOne();
                        syncRoot.WaitOne();
                    }

                    this.closed = true;
                }

                syncRoot.ReleaseMutex();
            }
        }

Usage Example

Пример #1
0
        public void TestAllTasksComplete()
        {
            ThreadPoolExecutor executor = new ThreadPoolExecutor();
            Assert.IsNotNull(executor);
            Assert.IsFalse(executor.IsShutdown);

            for(int i = 0; i < JOB_COUNT; ++i)
            {
                executor.QueueUserWorkItem(TaskThatCountsDown);
            }

            Assert.IsTrue(this.doneLatch.await(TimeSpan.FromMilliseconds(30 * 1000)));

            executor.Shutdown();
            Assert.IsTrue(executor.IsShutdown);
        }
All Usage Examples Of Apache.NMS.ActiveMQ.Threads.ThreadPoolExecutor::Shutdown