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

namespace ch14_2
{
    class PriorityTest
    {
        bool loopSwitch;
        public PriorityTest()
        {
            loopSwitch = true;
        }

        public bool LoopSwitch
        {
            set { loopSwitch = value; }
        }

        public void ThreadMethod()
        {
            long threadCount = 0;

            while (loopSwitch)
            {
                threadCount++;
            }
            Sharing.output += Thread.CurrentThread.Name + " with priority " +
                Thread.CurrentThread.Priority.ToString() + " has a count : " +
                threadCount.ToString("N0") + "\n";
        }
    }
}
