我正在阅读Microsoft的C# Language Specification for Asynchronous Functions,最后它包含了几个实现示例,所有这些代码都是这样的:
var x = await e;
扩展为:
$resume = delegate {
....
$a1 = (e).GetAwaiter();
...
if ($a1.IsCompleted) // <-- questionable line
{
$a1.OnCompleted($resume))
return;
}
...
};
好像有错字! if
测试不应该被否定吗?即:
if (!$a1.IsCompleted)