Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SynchronizationContext.GetAwaiter extension method #994

Merged
merged 1 commit into from Mar 8, 2022

Conversation

AArnott
Copy link
Member

@AArnott AArnott commented Mar 2, 2022

This makes await someSyncContext; work as expected.

This makes `await someSyncContext;` work as expected.
@AArnott AArnott added this to the v17.2 milestone Mar 2, 2022
Copy link

@Therzok Therzok left a comment

Choose a reason for hiding this comment

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

Nice!

@AArnott AArnott enabled auto-merge March 8, 2022 15:38
/// Gets a value indicating whether no yield is necessary.
/// </summary>
/// <value>Always returns <see langword="false"/>.</value>
public bool IsCompleted => false;
Copy link
Member

Choose a reason for hiding this comment

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

Do we ever want to short-cut this awaiter if the current SynchorizationContext matches what we want here?

@AArnott AArnott merged commit 683b45c into microsoft:main Mar 8, 2022
@AArnott AArnott deleted the SyncContextAwaiter branch March 25, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants