От: | Shmj | ||
Дата: | 12.11.20 13:19 | ||
Оценка: | 1 (1) -1 |
class Program
{
static void Main(string[] args)
{
bool b = true;
new Thread(() =>
{
Thread.Sleep(5000);
b = false;
}) {IsBackground = true}.Start();
while (b)
{
Console.WriteLine("b=" + b);
Thread.Sleep(1000);
}
Console.WriteLine("b=" + b);
}
}