using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace ch14_1
{
    class MyThread
    {
        public int count;
        public string s;
        string thrdName;

        public MyThread(string name)
        {
            count = 0;
            thrdName = name;
        }
        // Entry point of thread.
        public void run()
        {
            s = thrdName + " starting \n";
            do
            {
                Thread.Sleep(50);
                s = s + "In " + thrdName + ", count is " + count + "\n";
                count++;
            } while (count < 10);
            s += thrdName + " terminating.\n";
        }
    }
}
