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

ppltasks.cpp: Fix bincompat for VS 2015 #3255

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions stl/src/ppltasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ namespace Concurrency {
}

_CRTIMP2 bool __cdecl _Task_impl_base::_IsNonBlockingThread() {
// TRANSITION, ABI: This preprocessor directive attempts to fix VSO-1684985 (a bincompat issue affecting VS 2015 code)
// while preserving as much of GH-2654 as possible. When we can break ABI, we should:
// * Remove this preprocessor directive - it should be unnecessary after <ppltasks.h> was changed on 2018-01-12.
// * In <ppltasks.h>, reconsider whether _Task_impl_base::_Wait() should throw invalid_operation;
Copy link

Choose a reason for hiding this comment

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

I think this would be a great call.

// it's questionable whether that's conforming, and if users want to block their UI threads, we should let them.
// * Investigate whether we can avoid the ppltasks dependency entirely, making all of these issues irrelevant.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the way

#if defined(_CRT_APP) || defined(UNDOCKED_WINDOWS_UCRT)
APTTYPE _AptType;
APTTYPEQUALIFIER _AptTypeQualifier;

Expand Down Expand Up @@ -314,6 +321,8 @@ namespace Concurrency {
break;
}
}
#endif // defined(_CRT_APP) || defined(UNDOCKED_WINDOWS_UCRT)

return false;
}
} // namespace details
Expand Down