From 969934fb16f07c44f573b8038bc6e92659e0d940 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 5 Feb 2017 22:12:43 -0800 Subject: [PATCH] Fixed a deadlock in LocalLibrary --- src/core/library/LocalLibrary.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/library/LocalLibrary.cpp b/src/core/library/LocalLibrary.cpp index fdef5633c..b9b5405ca 100644 --- a/src/core/library/LocalLibrary.cpp +++ b/src/core/library/LocalLibrary.cpp @@ -199,13 +199,12 @@ void LocalLibrary::ThreadProc() { LocalQueryPtr query; while (true) { - std::unique_lock lock(this->mutex); - if ((query = GetNextQuery())) { this->RunQuery(query); } if (!this->queryQueue.size() && !this->Exited()) { + std::unique_lock lock(this->mutex); this->queueCondition.wait(lock); }