From 3d7b168dca955f6189a899fe782e9306656abda4 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 9 Jan 2025 20:38:13 -0800 Subject: [PATCH] disable ConditionalCoreSuspender on Linux until we can figure out why it doesn't behave properly --- library/Core.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/library/Core.cpp b/library/Core.cpp index e41f6f45e7..8538dd65e9 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -419,6 +419,9 @@ bool is_builtin(color_ostream &con, const std::string &command) { } void get_commands(color_ostream &con, std::vector &commands) { +#ifdef LINUX_BUILD + CoreSuspender suspend; +#else ConditionalCoreSuspender suspend{}; if (!suspend) { @@ -426,6 +429,7 @@ void get_commands(color_ostream &con, std::vector &commands) { commands.clear(); return; } +#endif auto L = DFHack::Core::getInstance().getLuaState(); Lua::StackUnwinder top(L); @@ -626,12 +630,17 @@ static std::string sc_event_name (state_change_event id) { } void help_helper(color_ostream &con, const std::string &entry_name) { +#ifdef LINUX_BUILD + CoreSuspender suspend; +#else ConditionalCoreSuspender suspend{}; if (!suspend) { con.printerr("Failed Lua call to helpdb.help (could not acquire core lock).\n"); return; } +#endif + auto L = DFHack::Core::getInstance().getLuaState(); Lua::StackUnwinder top(L); @@ -649,7 +658,17 @@ void help_helper(color_ostream &con, const std::string &entry_name) { } void tags_helper(color_ostream &con, const std::string &tag) { +#ifdef LINUX_BUILD CoreSuspender suspend; +#else + ConditionalCoreSuspender suspend{}; + + if (!suspend) { + con.printerr("Failed Lua call to helpdb.help (could not acquire core lock).\n"); + return; + } +#endif + auto L = DFHack::Core::getInstance().getLuaState(); Lua::StackUnwinder top(L); @@ -686,7 +705,17 @@ void ls_helper(color_ostream &con, const std::vector ¶ms) { filter.push_back(str); } +#ifdef LINUX_BUILD CoreSuspender suspend; +#else + ConditionalCoreSuspender suspend{}; + + if (!suspend) { + con.printerr("Failed Lua call to helpdb.help (could not acquire core lock).\n"); + return; + } +#endif + auto L = DFHack::Core::getInstance().getLuaState(); Lua::StackUnwinder top(L);