Commit 21a1979e authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Use atomic::exchange to set and test

(cherry picked from commit 15e3de0a)
parent b6fb92e4
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1019,10 +1019,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();
    }
}
}