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,8 +88,11 @@
throw std::runtime_error("can not stop main thread"); throw std::runtime_error("can not stop main thread");
} }
if (mainThread_->joinable())
{
mainThread_->join(); 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");
} }
if (schedulingThread_->joinable())
{
schedulingThread_->join(); schedulingThread_->join();
} }
}
void EventManager::Manager::start() void EventManager::Manager::start()
{ {