110,565
社区成员
发帖
与我相关
我的任务
分享
static bool result = true;
static void Main(string[] args)
{
var q = Task.Factory.StartNew(() => {
while (result)
{
Console.WriteLine("true");
Task.Delay(2000);
continue;
}
Console.WriteLine(false);
});
Thread.Sleep(3000);
result = false;
Console.ReadLine();
}