From 83098604fab6026aead97dca1bef0f770dd0bd60 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 23 Jan 2025 05:32:54 +1000 Subject: [PATCH] Set `MONO_THREADS_SUSPEND=preemptive` see #4117 --- Assets/EmuHawkMono.sh | 1 + Dist/launch-scripts.nix | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/EmuHawkMono.sh b/Assets/EmuHawkMono.sh index 7ca69f6ea6..8db5871ad9 100755 --- a/Assets/EmuHawkMono.sh +++ b/Assets/EmuHawkMono.sh @@ -17,6 +17,7 @@ if [ -z "$libpath" ]; then fi export LD_LIBRARY_PATH="$PWD/dll:$PWD:$libpath" export MONO_CRASH_NOFILE=1 +export MONO_THREADS_SUSPEND=preemptive # defaults to the experimental hybrid mode for some reason; this simpler mode performs better export MONO_WINFORMS_XIM_STYLE=disabled # see https://bugzilla.xamarin.com/show_bug.cgi?id=28047#c9 if [ "$1" = "--mono-no-redirect" ]; then # printf "(passing --mono-no-redirect is no longer necessary)\n" #TODO uncomment later diff --git a/Dist/launch-scripts.nix b/Dist/launch-scripts.nix index 27b54d6e8b..436478ee7c 100644 --- a/Dist/launch-scripts.nix +++ b/Dist/launch-scripts.nix @@ -104,7 +104,8 @@ fi ${if profileManagedCalls == false then "" else ''printf "Will write profiling results to %s/*.mlpd\n" "$PWD" ''}${if bizhawkAssemblies.hawkSourceInfo.hasAssemblyResolveHandler then "" else ''export MONO_PATH="$BIZHAWK_HOME/dll/nlua:$BIZHAWK_HOME/dll" - ''}${lib.optionalString (!debugPInvokes) "# "}export MONO_LOG_LEVEL=debug MONO_LOG_MASK=dll # pass `--arg debugPInvokes true` to nix-build to enable + ''}export MONO_THREADS_SUSPEND=preemptive + ${lib.optionalString (!debugPInvokes) "# "}export MONO_LOG_LEVEL=debug MONO_LOG_MASK=dll # pass `--arg debugPInvokes true` to nix-build to enable ${lib.optionalString debugDotnetHostCrashes "# "}export MONO_CRASH_NOFILE=1 # pass `--arg debugDotnetHostCrashes true` to nix-build to disable if [ "$1" = '--mono-no-redirect' ]; then printf "(passing --mono-no-redirect is no longer necessary)\n" >&2