mirror of https://github.com/Cysharp/UniTask
Fix timeoutTask continues to remain.
parent
b4ec35aadd
commit
623936c7b8
|
@ -101,7 +101,7 @@ namespace UniRx.Async
|
||||||
// left, right both suppress operation canceled exception.
|
// left, right both suppress operation canceled exception.
|
||||||
|
|
||||||
var delayCancellationTokenSource = new CancellationTokenSource();
|
var delayCancellationTokenSource = new CancellationTokenSource();
|
||||||
var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming).SuppressCancellationThrow();
|
var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming, delayCancellationTokenSource.Token).SuppressCancellationThrow();
|
||||||
|
|
||||||
var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask);
|
var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask);
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ namespace UniRx.Async
|
||||||
// left, right both suppress operation canceled exception.
|
// left, right both suppress operation canceled exception.
|
||||||
|
|
||||||
var delayCancellationTokenSource = new CancellationTokenSource();
|
var delayCancellationTokenSource = new CancellationTokenSource();
|
||||||
var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming).SuppressCancellationThrow();
|
var timeoutTask = (UniTask)UniTask.Delay(timeout, ignoreTimeScale, timeoutCheckTiming, delayCancellationTokenSource.Token).SuppressCancellationThrow();
|
||||||
|
|
||||||
var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask);
|
var (hasValue, value) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue