aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-02-25 18:49:31 +0100
committerGitHub Enterprise <[email protected]>2026-02-25 18:49:31 +0100
commitd7354c2ad34858d8ee99fb307685956c24abd897 (patch)
treee762fd39e6c68006631cf72ad9e908020cda202a /src/zenserver/main.cpp
parentHttpService/Frontend improvements (#782) (diff)
downloadzen-d7354c2ad34858d8ee99fb307685956c24abd897.tar.xz
zen-d7354c2ad34858d8ee99fb307685956c24abd897.zip
work around doctest shutdown issues with static CRT (#784)
* tweaked doctest.h to avoid shutdown issues due to thread_local variables running destructors after the main thread has torn down everything including the heap * disabled zenserver exit thread waiting since doctest should hopefully not be causing issues during shutdown anymore after my workaround This should help reduce the duration of tests spawning lots of server instances
Diffstat (limited to 'src/zenserver/main.cpp')
-rw-r--r--src/zenserver/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index ee783d2a6..571dd3b4f 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -267,6 +267,14 @@ main(int argc, char* argv[])
using namespace zen;
using namespace std::literals;
+ // note: doctest has locally (in thirdparty) been fixed to not cause shutdown
+ // crashes due to TLS destructors
+ //
+ // mimalloc on the other hand might still be causing issues, in which case
+ // we should work out either how to eliminate the mimalloc dependency or how
+ // to configure it in a way that doesn't cause shutdown issues
+
+#if 0
auto _ = zen::MakeGuard([] {
// Allow some time for worker threads to unravel, in an effort
// to prevent shutdown races in TLS object destruction, mainly due to
@@ -277,6 +285,7 @@ main(int argc, char* argv[])
// shutdown crashes observed in some situations.
WaitForThreads(1000);
});
+#endif
enum
{