summaryrefslogtreecommitdiff
path: root/modules/mono/mono_gd
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2019-08-30 01:33:50 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2019-08-30 01:33:50 +0200
commit5a6070dde3fcd6f13d55ed8b580487b6b1f42263 (patch)
tree56c1e11d42cd3342b64b6cfee7ee6351bebfb30e /modules/mono/mono_gd
parenta5e0aa32d9143b115b81788f504fb5bf1a27892a (diff)
Mono: Force preemptive thread suspend mode as a temporary workaround
Diffstat (limited to 'modules/mono/mono_gd')
-rw-r--r--modules/mono/mono_gd/gd_mono.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp
index aa69803a58..cd111abd4d 100644
--- a/modules/mono/mono_gd/gd_mono.cpp
+++ b/modules/mono/mono_gd/gd_mono.cpp
@@ -317,6 +317,13 @@ void GDMono::initialize() {
return;
#endif
+#if !defined(WINDOWS_ENABLED) && !defined(NO_MONO_THREADS_SUSPEND_WORKAROUND)
+ // FIXME: Temporary workaround. See: https://github.com/godotengine/godot/issues/29812
+ if (!OS::get_singleton()->has_environment("MONO_THREADS_SUSPEND")) {
+ OS::get_singleton()->set_environment("MONO_THREADS_SUSPEND", "preemptive");
+ }
+#endif
+
root_domain = mono_jit_init_version("GodotEngine.RootDomain", "v4.0.30319");
ERR_FAIL_NULL_MSG(root_domain, "Mono: Failed to initialize runtime.");