当前位置:网站首页>C task expansion method
C task expansion method
2022-07-07 03:37:00 【Sky watching houses】
TASK, English words , Noun 、 Verb , As a noun, it means “( difficult ) Mission , Work ;( In language teaching ) Activities ”, Being a verb means “ Send to sb ( Mission ); Yes ( Means or ability ) Highly demanding ”
If you want to perform a task alone , Ignore mistakes , This method is more suitable for use .
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp5
{
public static class PublicTaskExtensions
{
static readonly Action<Task> IgnoreTaskContinuation = task => _ = task.Exception;
public static void Ignore(this Task task)
{
if (task.IsCompleted)
{
_ = task.Exception;
}
else
{
task.ContinueWith(IgnoreTaskContinuation,
CancellationToken.None,
TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously,
TaskScheduler.Default);
}
}
}
}
边栏推荐
- Mobile measurement and depth link platform - Branch
- 20.(arcgis api for js篇)arcgis api for js面采集(SketchViewModel)
- 哈夫曼树基本概念
- Que savez - vous de la sérialisation et de l'anti - séquence?
- Kalman filter-1
- 浅谈网络安全之文件上传
- [leetcode] 700 and 701 (search and insert of binary search tree)
- Cryptography series: detailed explanation of online certificate status protocol OCSP
- QT 项目 表格新建列名称设置 需求练习(找数组消失的数字、最大值)
- VHDL实现任意大小矩阵加法运算
猜你喜欢
21.(arcgis api for js篇)arcgis api for js矩形采集(SketchViewModel)
QT 使用QToolTip 鼠标放上去显示文字时会把按钮的图片也显示了、修改提示文字样式
Not All Points Are Equal Learning Highly Efficient Point-based Detectors for 3D LiDAR Point
Kalman filter-1
【安全攻防】序列化与反序列,你了解多少?
枚举通用接口&枚举使用规范
如何自定义Latex停止运行的快捷键
19. (ArcGIS API for JS) ArcGIS API for JS line acquisition (sketchviewmodel)
树莓派设置wifi自动连接
22.(arcgis api for js篇)arcgis api for js圆采集(SketchViewModel)
随机推荐
Baidu map JS development, open a blank, bmapgl is not defined, err_ FILE_ NOT_ FOUND
ubuntu20安裝redisjson記錄
Free PHP online decryption tool source code v1.2
数学归纳与递归
About Tolerance Intervals
A 股指数成分数据 API 数据接口
What about SSL certificate errors? Solutions to common SSL certificate errors in browsers
QT thread and other 01 concepts
树莓派设置静态ip
SSL certificate deployment
QT 项目 表格新建列名称设置 需求练习(找数组消失的数字、最大值)
Tencent cloud native database tdsql-c was selected into the cloud native product catalog of the Academy of communications and communications
.net中 接口可以有默认实现了
Que savez - vous de la sérialisation et de l'anti - séquence?
My brave way to line -- elaborate on what happens when the browser enters the URL
Cryptography series: detailed explanation of online certificate status protocol OCSP
【安全攻防】序列化與反序列,你了解多少?
21.(arcgis api for js篇)arcgis api for js矩形采集(SketchViewModel)
ubuntu20安装redisjson记录
Clock in during winter vacation