mirror of
https://github.com/clangen/musikcube.git
synced 2025-04-15 20:42:33 +00:00
Fixed a deadlock in LocalLibrary
This commit is contained in:
parent
aa64784128
commit
969934fb16
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user