From 1413e20ed482e73c721f1e747d7277172ceffb1d Mon Sep 17 00:00:00 2001 From: Peter Ammon Date: Mon, 11 Sep 2017 15:50:41 -0700 Subject: [PATCH] Fix thread sanitizer errors in iothread This uses an atomic bool for main_thread_request_t::done. Fixes #3895 --- src/iothread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/iothread.cpp b/src/iothread.cpp index 0f465fa40..e3ca9f72c 100644 --- a/src/iothread.cpp +++ b/src/iothread.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -50,7 +51,7 @@ struct spawn_request_t { }; struct main_thread_request_t { - volatile bool done = false; + std::atomic done{false}; void_function_t func; main_thread_request_t(void_function_t &&f) : func(f) {}