Skip to content

Commit a49e00a

Browse files
committed
Don't pass any completed flags for iteration continuation.
1 parent 7113f37 commit a49e00a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/BenchmarkDotNet/Engines/WorkloadValueTaskSource.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ ValueTaskSourceStatus IValueTaskSource<bool>.GetStatus(short token)
4040
=> continuerSource.GetStatus(token);
4141

4242
void IValueTaskSource<bool>.OnCompleted(Action<object?> continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags)
43-
// Strip UseSchedulingContext to ensure Continue() and Complete() synchronously continue __WorkloadCore.
44-
=> continuerSource.OnCompleted(continuation, state, token, flags & ~ValueTaskSourceOnCompletedFlags.UseSchedulingContext);
43+
// This is where the async workload loop yields for the next iteration.
44+
// Ignore flags to always continue synchronously without capturing synchronization or execution context.
45+
=> continuerSource.OnCompleted(continuation, state, token, ValueTaskSourceOnCompletedFlags.None);
4546

4647
bool IValueTaskSource<bool>.GetResult(short token)
4748
=> continuerSource.GetResult(token);

0 commit comments

Comments
 (0)