diff --git a/src/events.cpp b/src/events.cpp index b7a53aff5b1..80a05bd4de6 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;