28 lines
655 B
C#
28 lines
655 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
|
|
namespace Matomat
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
Worker workerObject = new Worker();
|
|
Thread workerThread = new Thread(workerObject.DoWork);
|
|
|
|
workerThread.Start();
|
|
|
|
while (!workerThread.IsAlive) ;
|
|
|
|
while (workerThread.ThreadState == ThreadState.Running)
|
|
{
|
|
Thread.Sleep(1);
|
|
}
|
|
Console.WriteLine("main thread: Worker thread has terminated.");
|
|
}
|
|
}
|
|
}
|