-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Recognize JoinableTaskSynchronizationContext as a foreground kind #7749
Recognize JoinableTaskSynchronizationContext as a foreground kind #7749
Conversation
return kind; | ||
switch (syncConextTypeName) | ||
{ | ||
case "System.Windows.Threading.DispatcherSynchronizationContext": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor minor nit . I really don't like all your newlines here.
Any idea why all the tests are failing? |
@@ -18,7 +18,7 @@ public static T WaitAndGetResult<T>(this Task<T> task, CancellationToken cancell | |||
{ | |||
#if DEBUG | |||
var threadKind = ForegroundThreadDataInfo.CurrentForegroundThreadDataKind; | |||
if (threadKind != ForegroundThreadDataKind.Wpf && threadKind != ForegroundThreadDataKind.StaUnitTest) | |||
if (threadKind != ForegroundThreadDataKind.Unknown) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be ==. If you change to that and everything passes, then 👍 from me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, yeah. That's why you don't write code on New Year's Eve.
This is quick fix to prevent throwing asserts if CPS has changed the foreground SynchronizationContext.
1c0259c
to
3ae6474
Compare
👍 Thanks! |
I'll be looking into the failed mac build. Link to failed build. But in the meantime, |
…text-as-foreground-thread Recognize JoinableTaskSynchronizationContext as a foreground kind
This is quick fix to prevent throwing asserts if CPS has changed the foreground SynchronizationContext.
Looking at this, I suspect we could probably delete half of our foreground logic with something simpler,
but this unblocks others for now.
Review: @dotnet/roslyn-ide