Exemple #1
0
        public void ManyWaits()
        {
            /*
             * Show that multiple waits are benign.
             */
            ThreadWrapper tw = new ThreadWrapper();

            tw.StartThread();

            tw.WaitForReady();
            tw.WaitForReady();
            Assert.True(tw.InitIsDone);
            Thread.Sleep(4);
            Assert.True(tw.InitIsDone);
            tw.WaitForReady();
        }
Exemple #2
0
        public void CheckWait()
        {
            /*
             * Show that wait works for letting the Thread finish initializaion.
             */
            ThreadWrapper tw = new ThreadWrapper();

            tw.StartThread();
            Assert.False(tw.InitIsDone);
            tw.WaitForReady();
            Assert.True(tw.InitIsDone);
        }