@@ -83,7 +83,7 @@ module ValueTask =
8383 | Faulted exn , _ -> FromExceptions exn
8484 | Canceled , _ -> canceled
8585 else
86- let tcs = TaskCompletionSource< 'U> ()
86+ let tcs = TaskCompletionSource< 'U> TaskCreationOptions.RunContinuationsAsynchronously
8787 if task1.IsCanceled then tcs.SetCanceled ()
8888 elif task1.IsFaulted then tcs.SetException ( Unchecked.nonNull ( task1.AsTask() .Exception)) .InnerExceptions
8989 elif task2.IsCanceled then tcs.SetCanceled ()
@@ -110,7 +110,7 @@ module ValueTask =
110110 | _ , _ , Faulted exn -> FromExceptions exn
111111 | _ , _ , Canceled -> canceled
112112 else
113- let tcs = TaskCompletionSource< 'U> ()
113+ let tcs = TaskCompletionSource< 'U> TaskCreationOptions.RunContinuationsAsynchronously
114114 if task1.IsCanceled then tcs.SetCanceled ()
115115 elif task1.IsFaulted then tcs.SetException ( Unchecked.nonNull ( task1.AsTask() .Exception)) .InnerExceptions
116116 elif task2.IsCanceled then tcs.SetCanceled ()
@@ -227,7 +227,7 @@ module ValueTask =
227227 | Faulted exn , _ -> FromExceptions exn
228228 | Canceled , _ -> canceled
229229 else
230- let tcs = TaskCompletionSource< 'U> ()
230+ let tcs = TaskCompletionSource< 'U> TaskCreationOptions.RunContinuationsAsynchronously
231231 if f.IsCanceled then tcs.SetCanceled ()
232232 elif f.IsFaulted then tcs.SetException ( Unchecked.nonNull ( f.AsTask() .Exception)) .InnerExceptions
233233 elif x.IsCanceled then tcs.SetCanceled ()
@@ -343,4 +343,4 @@ module ValueTask =
343343 /// <returns >A ValueTask that is completed unsuccessfully with the specified exception.</returns >
344344 let raise < 'T > ( exn : exn ) : ValueTask < 'T > = ValueTask.FromException< 'T> exn
345345
346- #endif
346+ #endif
0 commit comments