When cynara thread start fails with exception its destructor
unnecessarily calls join on thread (which blocks).
Change-Id: Ieb1d5727fecf09af7ae557aacf689d4b578e65e0
namespace Agent {
CynaraTalker::CynaraTalker(RequestHandler requestHandler) : m_requestHandler(requestHandler),
- m_cynara(nullptr) {
+ m_cynara(nullptr)
+{
m_future = m_threadFinished.get_future();
}
}
bool CynaraTalker::stop() {
+ if (!m_thread.joinable())
+ return true;
// There is no possibility to stop this thread nicely when it waits for requests from cynara
// We can only try to get rid of thread
auto status = m_future.wait_for(std::chrono::milliseconds(10));