Fixed a deadlock in LocalLibrary

This commit is contained in:
casey langen 2017-02-05 22:12:43 -08:00
parent aa64784128
commit 969934fb16

View File

@ -199,13 +199,12 @@ void LocalLibrary::ThreadProc() {
LocalQueryPtr query; LocalQueryPtr query;
while (true) { while (true) {
std::unique_lock<std::mutex> lock(this->mutex);
if ((query = GetNextQuery())) { if ((query = GetNextQuery())) {
this->RunQuery(query); this->RunQuery(query);
} }
if (!this->queryQueue.size() && !this->Exited()) { if (!this->queryQueue.size() && !this->Exited()) {
std::unique_lock<std::mutex> lock(this->mutex);
this->queueCondition.wait(lock); this->queueCondition.wait(lock);
} }