Exemple #1
0
        public void join1()
        {
            // free pool thread count exceeded or pool closed
            FreePool p = new FreePool(2);

            p.Join();

            MyPoolRunnable r = new MyPoolRunnable(0, false);

            p.Run(r.run, r.exception);
        }
Exemple #2
0
        public void join2()
        {
            FreePool p = new FreePool(2);

            MyPoolRunnable r = new MyPoolRunnable(0, false);

            Assert.IsFalse(r.done);
            Assert.IsNull(r.ex);
            p.Run(r.run, r.exception);
            Thread.Sleep(Q2);
            Assert.IsTrue(r.done);
            Assert.IsNull(r.ex);
            p.Join();
        }