using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;

namespace ch14_1_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            label1.Text = "Main thread starting.\n";
            // First, construct a MyThread object.
            MyThread mt = new MyThread("Thread #1");
            do
            {
                Thread.Sleep(100);
            } while (mt.count != 10);
            label1.Text += mt.s;
            label1.Text += "Main thread ending.";
        }
    }
}
