Skip to content

Conversation

@oldnewthing
Copy link
Member

Fixes #1001

private:
static fire_and_forget cancel_asynchronously(Async async)
{
#ifdef WINRT_IMPL_COROUTINES
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not call submit_threadpool_callback instead of changing the semantics of this function?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I had a note to make this fix better, but this is to unblock "cannot build because of compiler errors" which is significantly more urgent.

Copy link
Member

Choose a reason for hiding this comment

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

Could this type just be excluded entirely? Seems only to be used by operator co_await further down in the file (which is also conditioned on WINRT_IMPL_COROUTINES).

As is, I'd expect this to still give compilation errors, but of the form "function has no return"

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I went and did it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's try to avoid further feature creep. It's useful to have fixes stand alone in PRs so they can easily be rolled back and reapplied if needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

The previous fix was incomplete. It kept the compiler happy but didn't preserve behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dunhor Ooh, good point. I missed that it's used only by co_await. Let me see what happens if I take it out entirely.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got it 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

@dunhor Okay, it works. I had to comment out a boatload of tests that used co_await, but the rest of them build successfully when WINRT_IMPL_COROUTINES is disabled.

@kennykerr kennykerr merged commit 4366357 into master Aug 19, 2021
@kennykerr kennykerr deleted the protect_coroutines branch August 19, 2021 17:13
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.

Windows.Foundation.h has a few unguarded uses of co_await

5 participants