From 792abf61eca01dd677415db2508de9458f74e460 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 31 Dec 2020 17:03:53 -0800 Subject: [PATCH] Attempt to fix the tsan build Deliberately leak the shared thread pool to avoid shutdown dtor registration and tsan complaints at exit. --- src/iothread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/iothread.cpp b/src/iothread.cpp index ae55049af..57dda3caf 100644 --- a/src/iothread.cpp +++ b/src/iothread.cpp @@ -131,7 +131,8 @@ struct thread_pool_t { /// The thread pool for "iothreads" which are used to lift I/O off of the main thread. /// These are used for completions, etc. -static thread_pool_t s_io_thread_pool(1, IO_MAX_THREADS); +/// Leaked to avoid shutdown dtor registration (including tsan). +static thread_pool_t &s_io_thread_pool = *(new thread_pool_t(1, IO_MAX_THREADS)); static owning_lock> s_result_queue;