mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-18 05:00:14 +00:00
WhenAll and WhenAny
This commit is contained in:
@@ -96,7 +96,7 @@ namespace UniRx.Async
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
core.SetCanceled(cancellationToken);
|
||||
core.TrySetCanceled(cancellationToken);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -109,11 +109,11 @@ namespace UniRx.Async
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
core.SetException(ex);
|
||||
core.TrySetException(ex);
|
||||
return false;
|
||||
}
|
||||
|
||||
core.SetResult(null);
|
||||
core.TrySetResult(null);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -126,6 +126,14 @@ namespace UniRx.Async
|
||||
exception = default;
|
||||
}
|
||||
|
||||
~EnumeratorPromise()
|
||||
{
|
||||
if (pool.TryReturn(this))
|
||||
{
|
||||
GC.ReRegisterForFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
// Unwrap YieldInstructions
|
||||
|
||||
static IEnumerator ConsumeEnumerator(IEnumerator enumerator)
|
||||
|
||||
Reference in New Issue
Block a user