From 58880c845317a29a4848571807418f9565e0aff6 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Fri, 8 Jun 2018 07:33:42 +1100 Subject: [PATCH] Ensure events::call_in_main_thread is thread-safe (cherry-picked from commit b70463b6adbeb235ba24da315627c5dba79b5e75) --- src/events.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events.cpp b/src/events.cpp index b7a53aff5b1c..80a05bd4de6e 100644 --- a/src/events.cpp +++ b/src/events.cpp @@ -53,7 +53,7 @@ struct invoked_function_data const std::function& f; /** Whether execution in the main thread is complete. */ - bool finished = false; + std::atomic_bool finished = false; /** Stores any exception thrown during the execution of @ref f. */ std::exception_ptr thrown_exception;