随笔分类 -  多线程

摘要:static void Main(string[] args) { //1.创建取消令牌数据 CancellationTokenSource tokenSource = new CancellationTokenSource(); //2.创建取消令牌 CancellationToken token 阅读全文
posted @ 2022-12-02 11:43 园友2288976 阅读(83) 评论(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 阅读(66) 评论(0) 推荐(0) 编辑
摘要://1.创建取消令牌数据 CancellationTokenSource tokenSource = new CancellationTokenSource(); //2.创建取消令牌 CancellationToken token = tokenSource.Token; Task.Run(() 阅读全文
posted @ 2022-12-02 11:34 园友2288976 阅读(173) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示