From b8b51ee07baadcda027d4427ad64218faee3e748 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Tue, 29 Nov 2022 18:51:33 -0800 Subject: [PATCH] Attempt to fix VSO-1684985 by partially reverting GH 2654. --- stl/src/ppltasks.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stl/src/ppltasks.cpp b/stl/src/ppltasks.cpp index c577b5bdba..de405dd6cf 100644 --- a/stl/src/ppltasks.cpp +++ b/stl/src/ppltasks.cpp @@ -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 was changed on 2018-01-12. +// * In , reconsider whether _Task_impl_base::_Wait() should throw invalid_operation; +// 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. +#if defined(_CRT_APP) || defined(UNDOCKED_WINDOWS_UCRT) APTTYPE _AptType; APTTYPEQUALIFIER _AptTypeQualifier; @@ -314,6 +321,8 @@ namespace Concurrency { break; } } +#endif // defined(_CRT_APP) || defined(UNDOCKED_WINDOWS_UCRT) + return false; } } // namespace details