Microsoft.Ccr.Core.DispatcherQueue.Dispose C# (CSharp) Method

Dispose() public method

public Dispose ( ) : void
return void
        public void Dispose()
        {
            Dispose (true);
        }

Same methods

DispatcherQueue::Dispose ( bool disposing ) : void

Usage Example

Beispiel #1
0
        private static void Run(int n, int threadCount)
        {
            Dispatcher d = new Dispatcher(threadCount, "ccr pool");
            DispatcherQueue dq = new DispatcherQueue("disp", d);
            Port<int> p1 = new Port<int>(),  p2 = new Port<int>();
            EventWaitHandle done1 = new AutoResetEvent(false), done2 = new AutoResetEvent(false);

            PingPonger pp1 = new PingPonger(done1, n, p2),
                pp2 = new PingPonger(done2, n, p1);

            Arbiter.Activate(dq, Arbiter.Interleave(
                new TeardownReceiverGroup(),
                new ExclusiveReceiverGroup(Arbiter.Receive(true, p1, pp1.Update)),
                new ConcurrentReceiverGroup()));

            Arbiter.Activate(dq, Arbiter.Interleave(
                new TeardownReceiverGroup(),
                new ExclusiveReceiverGroup(Arbiter.Receive(true, p2, pp2.Update)),
                new ConcurrentReceiverGroup()));

            p1.Post(0);

            EventWaitHandle.WaitAll(new[] { done1, done2 });

            dq.Dispose();
            d.Dispose();
        }
All Usage Examples Of Microsoft.Ccr.Core.DispatcherQueue::Dispose