Skip to content

Remove obsolete TaskCompletionSourceWithoutInlining<T> class#1617

Merged
AArnott merged 1 commit into
mainfrom
dev/andarno/removeOldTCS
Jul 10, 2026
Merged

Remove obsolete TaskCompletionSourceWithoutInlining<T> class#1617
AArnott merged 1 commit into
mainfrom
dev/andarno/removeOldTCS

Conversation

@AArnott

@AArnott AArnott commented Jul 9, 2026

Copy link
Copy Markdown
Member

Remove obsolete TaskCompletionSourceWithoutInlining<T> class

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.

Copilot AI review requested due to automatic review settings July 9, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .NET TaskCompletionSource<T>.
  • Replaced all usages with TaskCompletionSource<T> constructed with RunContinuationsAsynchronously where appropriate.
  • Simplified related implementations and removed now-unused using directives.

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.

Comment thread src/Microsoft.VisualStudio.Threading/AsyncManualResetEvent.cs Outdated
Comment thread src/Microsoft.VisualStudio.Threading/AsyncManualResetEvent.cs Outdated
Copilot AI review requested due to automatic review settings July 9, 2026 16:57
@AArnott AArnott force-pushed the dev/andarno/removeOldTCS branch from 15769ab to 96f4784 Compare July 9, 2026 16:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread src/Microsoft.VisualStudio.Threading/AsyncManualResetEvent.cs
@AArnott AArnott requested a review from lifengl July 9, 2026 17:30
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.
Copilot AI review requested due to automatic review settings July 9, 2026 23:02
@AArnott AArnott force-pushed the dev/andarno/removeOldTCS branch from 96f4784 to 7d23f03 Compare July 9, 2026 23:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@AArnott AArnott enabled auto-merge July 10, 2026 13:39
@AArnott AArnott merged commit 1004ef0 into main Jul 10, 2026
10 checks passed
@AArnott AArnott deleted the dev/andarno/removeOldTCS branch July 10, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants