[IPC] Better worker cleanup

This commit is contained in:
momo5502 2017-01-29 11:48:42 +01:00
parent 0139465337
commit 67d963a0c8

View File

@ -14,13 +14,12 @@ namespace Utils
Channel::~Channel() Channel::~Channel()
{ {
{ std::unique_lock<std::mutex> lock(this->queueMutex);
std::lock_guard<std::mutex> _(this->queueMutex); this->terminateQueue = true;
this->terminateQueue = true; this->queueEvent.notify_all();
this->queueEvent.notify_all(); lock.unlock();
}
if(this->queueThread.joinable()) if (this->queueThread.joinable())
{ {
this->queueThread.join(); this->queueThread.join();
} }