You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree. Even if the caller checks the return result against default this is no indication the task timed out because the running task may actually return null if T is a reference type. And yes, if the delay task completes first then the original task will remain running.
The only way to do this correctly is for the caller to use a CancellationTokenSource and have this cancelled if the delay task completes first. It's then up to the caller to handle this situation within their own logic by checking IsCancellationRequested on the CancellationToken.
Hi, looking at the implementation -- won't the net result be that; the task itself will not stop running even if the timeout succeeds first?
Is that intentional?
The text was updated successfully, but these errors were encountered: