摘要: static void Main(string[] args) { //1.创建取消令牌数据 CancellationTokenSource tokenSource = new CancellationTokenSource(); //2.创建取消令牌 CancellationToken token 阅读全文
posted @ 2022-12-02 11:43 园友2288976 阅读(69) 评论(0) 推荐(0) 编辑
摘要: Task.Run(() => {for (int i = 0; i < 20; i++) { Console.WriteLine(i); } } }).ContinueWith(NewTask); private static void NewTask(Task T) { Console.Write 阅读全文
posted @ 2022-12-02 11:36 园友2288976 阅读(54) 评论(0) 推荐(0) 编辑
摘要: //1.创建取消令牌数据 CancellationTokenSource tokenSource = new CancellationTokenSource(); //2.创建取消令牌 CancellationToken token = tokenSource.Token; Task.Run(() 阅读全文
posted @ 2022-12-02 11:34 园友2288976 阅读(153) 评论(0) 推荐(0) 编辑