Example #1
0
        static void Main2(string[] args)
        {
            Worker w = new Worker();
            ParameterizedThreadStart ts =
                new ParameterizedThreadStart(w.DoWork);
            Thread t1 = new Thread(ts);
            t1.Start("*********HAPPY DIWALI******");

            w.DoWork("###########################");
        }
Example #2
0
        static void Main2(string[] args)
        {
            Worker w = new Worker();
            ParameterizedThreadStart ts =
                new ParameterizedThreadStart(w.DoWork);
            Thread t1 = new Thread(ts);

            t1.Start("*********HAPPY DIWALI******");

            w.DoWork("###########################");
        }
Example #3
0
        static void Main(string[] args)
        {
            Worker w = new Worker();
            ParameterizedThreadStart ts =
                new ParameterizedThreadStart(w.DoWork);
            Thread t1 = new Thread(ts);
            t1.IsBackground = true;

            t1.Start("*********HAPPY DIWALI******");

            w.DoWork("######");

            if (t1.Join(10000))
            {
                Console.WriteLine("Joined Successfully");
            }
            else
            {
                Console.WriteLine("Join Failed..");
            }
        }
Example #4
0
        static void Main(string[] args)
        {
            Worker w = new Worker();
            ParameterizedThreadStart ts =
                new ParameterizedThreadStart(w.DoWork);
            Thread t1 = new Thread(ts);

            t1.IsBackground = true;

            t1.Start("*********HAPPY DIWALI******");


            w.DoWork("######");

            if (t1.Join(10000))
            {
                Console.WriteLine("Joined Successfully");
            }
            else
            {
                Console.WriteLine("Join Failed..");
            }
        }