From b0fe99f1ec42cca00c9a54bdc6e96cbce84ce357 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 31 Oct 2023 16:11:09 +0100 Subject: [PATCH] Disable mono thread attach to fix current freeze on GC STW event --- Source/Engine/Scripting/Runtime/DotNet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/Scripting/Runtime/DotNet.cpp b/Source/Engine/Scripting/Runtime/DotNet.cpp index 91b1d3dde..47f9b0a7c 100644 --- a/Source/Engine/Scripting/Runtime/DotNet.cpp +++ b/Source/Engine/Scripting/Runtime/DotNet.cpp @@ -524,7 +524,7 @@ void MCore::GC::FreeMemory(void* ptr, bool coTaskMem) void MCore::Thread::Attach() { // TODO: find a way to properly register native thread so Mono Stop The World (stw) won't freeze when native threads (eg. Job System) are running native code only -#if DOTNET_HOST_MONO && !USE_MONO_AOT +#if DOTNET_HOST_MONO && 0 if (!IsInMainThread() && !mono_domain_get()) { mono_thread_attach(MonoDomainHandle);