随笔分类 - 多线程
摘要:static void Main(string[] args) { //1.创建取消令牌数据 CancellationTokenSource tokenSource = new CancellationTokenSource(); //2.创建取消令牌 CancellationToken token
阅读全文
摘要:Task.Run(() => {for (int i = 0; i < 20; i++) { Console.WriteLine(i); } } }).ContinueWith(NewTask); private static void NewTask(Task T) { Console.Write
阅读全文
摘要://1.创建取消令牌数据 CancellationTokenSource tokenSource = new CancellationTokenSource(); //2.创建取消令牌 CancellationToken token = tokenSource.Token; Task.Run(()
阅读全文