浏览代码

Port fix for race condition (https://github.com/dotnet/coreclr/pull/22711).

Bart De Smet 6 年之前
父节点
当前提交
29a3f081a1

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Threading/Tasks/Sources/ManualResetValueTaskSourceCore.cs

@@ -81,7 +81,7 @@ namespace System.Threading.Tasks.Sources
         {
             ValidateToken(token);
             return
-                !_completed ? ValueTaskSourceStatus.Pending :
+                _continuation == null || !_completed ? ValueTaskSourceStatus.Pending :
                 _error == null ? ValueTaskSourceStatus.Succeeded :
                 _error.SourceException is OperationCanceledException ? ValueTaskSourceStatus.Canceled :
                 ValueTaskSourceStatus.Faulted;