Commit 15e3de0a authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Use atomic::exchange to set and test

parent f70cb651
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1024,10 +1024,7 @@ void ModuleManager::finalize() {
 * All modules in the event loop continue to finish the current event
 */
void ModuleManager::terminate() {
    if(!terminate_) {
        terminate_ = true;
        if(thread_pool_) {
    if(!terminate_.exchange(true) && thread_pool_) {
        thread_pool_->destroy();
    }
}
}