FIX: test if thread is joinable before join

This commit is contained in:
Dominik Meyer 2024-01-16 12:25:53 +01:00
parent caa13b0159
commit 22ff983817
Signed by: byterazor
GPG Key ID: EABDA0FD5981BC97

View File

@ -88,7 +88,10 @@
throw std::runtime_error("can not stop main thread"); throw std::runtime_error("can not stop main thread");
} }
mainThread_->join(); if (mainThread_->joinable())
{
mainThread_->join();
}
} }
void EventManager::Manager::stopScheduling_() void EventManager::Manager::stopScheduling_()
@ -107,8 +110,11 @@
throw std::runtime_error("can not stop scheduling thread"); throw std::runtime_error("can not stop scheduling thread");
} }
schedulingThread_->join(); if (schedulingThread_->joinable())
} {
schedulingThread_->join();
}
}
void EventManager::Manager::start() void EventManager::Manager::start()
{ {