Remove obsolete TaskCompletionSourceWithoutInlining<T> class#1617
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the obsolete internal TaskCompletionSourceWithoutInlining<T> wrapper and updates all call sites to use TaskCompletionSource<T> directly, relying on TaskCreationOptions.RunContinuationsAsynchronously where non-inlining behavior is required.
Changes:
- Deleted
TaskCompletionSourceWithoutInlining<T>as it was effectively a pass-through to .NETTaskCompletionSource<T>. - Replaced all usages with
TaskCompletionSource<T>constructed withRunContinuationsAsynchronouslywhere appropriate. - Simplified related implementations and removed now-unused
usingdirectives.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.VisualStudio.Threading/TaskCompletionSourceWithoutInlining`1.cs | Removes the obsolete internal wrapper type. |
| src/Microsoft.VisualStudio.Threading/JoinableTask`1.cs | Switches joinable task completion sources to TaskCompletionSource<T>(RunContinuationsAsynchronously). |
| src/Microsoft.VisualStudio.Threading/JoinableTask.cs | Updates the non-generic joinable task completion source creation/access/completion to use TaskCompletionSource<EmptyStruct>. |
| src/Microsoft.VisualStudio.Threading/AsyncQueue`1.cs | Replaces dequeuer waiter TCS creation with TaskCompletionSource<T>(RunContinuationsAsynchronously). |
| src/Microsoft.VisualStudio.Threading/AsyncManualResetEvent.cs | Replaces the custom TCS type with TaskCompletionSource<EmptyStruct> and centralizes options; updates related logic. |
| src/Microsoft.VisualStudio.Threading/AsyncAutoResetEvent.cs | Updates the private waiter completion source base type and uses appropriate TCS options for inlining vs async continuations. |
15769ab to
96f4784
Compare
This was originally created before .NET Framework offered the `RunContinuationsAsynchronously` flag. When support for the flag was added, but we still supported downlevel systems, we updated the class to use the flag when supported as a light-up, and keep our old implementation around for downlevel. Then later, we removed the downlevel implementation, but kept the class, which was now just forwarding everything to .NET in every case. So here, I remove the class and redirect all its users to the proper .NET types.
96f4784 to
7d23f03
Compare
lifengl
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove obsolete
TaskCompletionSourceWithoutInlining<T>classThis was originally created before .NET Framework offered the
RunContinuationsAsynchronouslyflag. When support for the flag was added, but we still supported downlevel systems, we updated the class to use the flag when supported as a light-up, and keep our old implementation around for downlevel. Then later, we removed the downlevel implementation, but kept the class, which was now just forwarding everything to .NET in every case.So here, I remove the class and redirect all its users to the proper .NET types.