Exemplo n.º 1
0
        static void volatileTest()
        {
            VolatileTest test = new VolatileTest();

            Thread th = new Thread(() =>
            {
                while (true)
                {
                    test.Wait();
                }
            }
                                   );

            th.Start();

            Thread th2 = new Thread(() =>
            {
                while (true)
                {
                    test.WakeUp();
                }
            }
                                    );

            th2.Start();
        }
Exemplo n.º 2
0
        static void volatileTest()
        {
            VolatileTest test = new VolatileTest();

            Thread th = new Thread(() =>
            {
                while (true)
                {
                    test.Wait();
                }
            }
            );
            th.Start();

            Thread th2 = new Thread(() =>
            {
                while (true)
                {
                    test.WakeUp();
                }
            }
            );
            th2.Start();
        }