Fix thread sanitizer errors in iothread

This uses an atomic bool for main_thread_request_t::done.

Fixes #3895
This commit is contained in:
Peter Ammon 2017-09-11 15:50:41 -07:00
parent 4284e58033
commit 1413e20ed4

View file

@ -7,6 +7,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <atomic>
#include <condition_variable> #include <condition_variable>
#include <queue> #include <queue>
@ -50,7 +51,7 @@ struct spawn_request_t {
}; };
struct main_thread_request_t { struct main_thread_request_t {
volatile bool done = false; std::atomic<bool> done{false};
void_function_t func; void_function_t func;
main_thread_request_t(void_function_t &&f) : func(f) {} main_thread_request_t(void_function_t &&f) : func(f) {}