fix ComibineLatest

master
neuecc 2020-05-22 11:08:03 +09:00
parent 2b7986da19
commit 1d88ed85bc
2 changed files with 240 additions and 0 deletions

View File

@ -159,6 +159,7 @@ namespace Cysharp.Threading.Tasks.Linq
} }
catch (Exception ex) catch (Exception ex)
{ {
self.running<#= j #> = true; // as complete, no more call MoveNextAsync.
self.completedCount = CompleteCount; self.completedCount = CompleteCount;
self.completionSource.TrySetException(ex); self.completionSource.TrySetException(ex);
return; return;
@ -168,6 +169,7 @@ namespace Cysharp.Threading.Tasks.Linq
if (!self.TrySetResult()) if (!self.TrySetResult())
{ {
if (self.syncRunning) return; if (self.syncRunning) return;
self.running<#= j #> = true; // as complete, no more call MoveNextAsync.
try try
{ {
self.awaiter<#= j #> = self.enumerator<#= j #>.MoveNextAsync().GetAwaiter(); self.awaiter<#= j #> = self.enumerator<#= j #>.MoveNextAsync().GetAwaiter();