示例#1
0
文件: Program.cs 项目: nicho1991/SWD
        static void Main(string[] args)
        {
            HelloWriter x = new HelloWriter();
            HelloWriter y = new HelloWriter();


            Thread a = new Thread(() => x.sayHello("james", 5));

            x.sleepPeriod = 200;
            a.Start();

            Thread b = new Thread(() => y.sayHello("other james", 10));

            y.sleepPeriod = 500;
            b.Start();

            NeverEnding c = new NeverEnding();
            Thread      d = new Thread(() => c.neverEndindStory());

            d.Start();

            a.Join();
            b.Join();


            Console.WriteLine("Hello World from main");
        }
示例#2
0
文件: Program.cs 项目: nicho1991/SWD
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            HelloWriter x = new HelloWriter();

            Thread a = new Thread(() => x.sayHello("james"));

            a.Start();

            Thread b = new Thread(() => x.sayHello("other james"));

            b.Start();
        }
示例#3
0
文件: Program.cs 项目: nicho1991/SWD
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            HelloWriter x = new HelloWriter();
            HelloWriter y = new HelloWriter();


            Thread a = new Thread(() => x.sayHello("james", 5));

            x.sleepPeriod = 200;
            a.Start();

            Thread b = new Thread(() => y.sayHello("other james", 10));

            y.sleepPeriod = 500;
            b.Start();
        }