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

Coordinated fix for capturing continuation context for tasks in Desktop apps #2654

Merged
merged 5 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ function(add_stl_dlls D_SUFFIX THIS_CONFIG_DEFINITIONS THIS_CONFIG_COMPILE_OPTIO
target_compile_options(msvcp${D_SUFFIX}_eha_objects PRIVATE "${THIS_CONFIG_COMPILE_OPTIONS};${GL_FLAG};/EHa")

StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
add_library(msvcp${D_SUFFIX} SHARED)
target_link_libraries(msvcp${D_SUFFIX} PRIVATE msvcp${D_SUFFIX}_eha_objects msvcp${D_SUFFIX}_objects msvcp${D_SUFFIX}_init_objects "${TOOLSET_LIB}/vcruntime${D_SUFFIX}.lib" "${TOOLSET_LIB}/msvcrt${D_SUFFIX}.lib" "ucrt${D_SUFFIX}.lib")
target_link_libraries(msvcp${D_SUFFIX} PRIVATE msvcp${D_SUFFIX}_eha_objects msvcp${D_SUFFIX}_objects msvcp${D_SUFFIX}_init_objects "${TOOLSET_LIB}/vcruntime${D_SUFFIX}.lib" "${TOOLSET_LIB}/msvcrt${D_SUFFIX}.lib" "ucrt${D_SUFFIX}.lib" "ole32.lib")
Scottj1s marked this conversation as resolved.
Show resolved Hide resolved
set_target_properties(msvcp${D_SUFFIX} PROPERTIES ARCHIVE_OUTPUT_NAME "msvcp140_base${D_SUFFIX}${VCLIBS_SUFFIX}")
set_target_properties(msvcp${D_SUFFIX} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
set_target_properties(msvcp${D_SUFFIX} PROPERTIES OUTPUT_NAME "msvcp140${D_SUFFIX}${VCLIBS_SUFFIX}")
Expand Down
25 changes: 2 additions & 23 deletions stl/src/ppltasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include <Windows.h>

#if defined(_CRT_APP) || defined(UNDOCKED_WINDOWS_UCRT)
#ifndef UNDOCKED_WINDOWS_UCRT
#pragma warning(push)
#pragma warning(disable : 4265) // non-virtual destructor in base class
Expand All @@ -19,7 +18,8 @@
#include <ctxtcall.h>
#include <mutex>
#include <windows.foundation.diagnostics.h>
#endif

#pragma comment(lib, "ole32")
Scottj1s marked this conversation as resolved.
Show resolved Hide resolved

// This IID is exported by ole32.dll; we cannot depend on ole32.dll on OneCore.
Scottj1s marked this conversation as resolved.
Show resolved Hide resolved
static GUID const Local_IID_ICallbackWithNoReentrancyToApplicationSTA = {
Expand Down Expand Up @@ -217,7 +217,6 @@ namespace Concurrency {
_CRTIMP2 void __thiscall _TaskEventLogger::_LogWorkItemCompleted() {}
#endif

#if defined(_CRT_APP) || defined(UNDOCKED_WINDOWS_UCRT)
using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Foundation::Diagnostics;
using namespace Microsoft::WRL;
Expand Down Expand Up @@ -317,26 +316,6 @@ namespace Concurrency {
}
return false;
}

#else
_CRTIMP2 void __thiscall _ContextCallback::_CallInContext(_CallbackFunction _Func, bool) const {
_Func();
}

_CRTIMP2 void __thiscall _ContextCallback::_Capture() {}

_CRTIMP2 void __thiscall _ContextCallback::_Reset() {}

_CRTIMP2 void __thiscall _ContextCallback::_Assign(void*) {}

_CRTIMP2 bool __cdecl _ContextCallback::_IsCurrentOriginSTA() {
return false;
}

_CRTIMP2 bool __cdecl _Task_impl_base::_IsNonBlockingThread() {
return false;
}
#endif
} // namespace details

#ifdef _CRT_APP
Expand Down