От: | #John | https://github.com/ichensky | |
Дата: | 06.12.18 09:49 | ||
Оценка: |
class Program
{
static bool _stopTask = false;
static Thread Task() {
return new Thread(() => {
int x = 0;
while (!_stopTask) {
x++;
}
});
}
static void Main()
{
var t = Task();
t.Start();
Thread.Sleep(1000);
_stopTask = true;
t.Join();
Console.WriteLine("exit");
}
}