当前位置:网站首页>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);
}
}
}
}
边栏推荐
- Enumeration general interface & enumeration usage specification
- Variables, process control and cursors (MySQL)
- Decoration design enterprise website management system source code (including mobile source code)
- Search of linear table
- A 股指数成分数据 API 数据接口
- 2022年上半年HIT行业TOP50
- 编译常量、ClassLoader类、系统类加载器深度探析
- 21.(arcgis api for js篇)arcgis api for js矩形采集(SketchViewModel)
- 复杂因子计算优化案例:深度不平衡、买卖压力指标、波动率计算
- Appx code signing Guide
猜你喜欢
RestClould ETL 社区版六月精选问答
ubuntu20安装redisjson记录
1200.Minimum Absolute Difference
Baidu map JS development, open a blank, bmapgl is not defined, err_ FILE_ NOT_ FOUND
[safe office and productivity application] Shanghai daoning provides you with onlyoffice download, trial and tutorial
About Confidence Intervals
2022年上半年HIT行业TOP50
Set WiFi automatic connection for raspberry pie
如何自定义Latex停止运行的快捷键
The latest 2022 review of "small sample deep learning image recognition"
随机推荐
如何自定义Latex停止运行的快捷键
【安全攻防】序列化与反序列,你了解多少?
Restcloud ETL Community Edition June featured Q & A
存储过程与函数(MySQL)
QT thread and other 01 concepts
浅谈网络安全之文件上传
21. (article ArcGIS API for JS) ArcGIS API for JS rectangular acquisition (sketchviewmodel)
Not All Points Are Equal Learning Highly Efficient Point-based Detectors for 3D LiDAR Point
[Dameng database] after backup and recovery, two SQL statements should be executed
Cryptography series: detailed explanation of online certificate status protocol OCSP
Leetcode-02 (linked list question)
Function reentry, function overloading and function rewriting are understood by yourself
Tencent cloud native database tdsql-c was selected into the cloud native product catalog of the Academy of communications and communications
Sub pixel corner detection opencv cornersubpix
input_ delay
Index of MySQL
【安全攻防】序列化與反序列,你了解多少?
Variables, process control and cursors (MySQL)
20. (ArcGIS API for JS) ArcGIS API for JS surface collection (sketchviewmodel)
2022.6.28