From 426e16c75b58382b1c25234805af3b6059e7a929 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Sat, 20 Oct 2018 02:49:46 +0200 Subject: [PATCH] data: Fixed real deadlock in interprocess indexer when command queue is empty on start --- src/lib/data/indexer/interprocess/InterprocessIndexer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/data/indexer/interprocess/InterprocessIndexer.cpp b/src/lib/data/indexer/interprocess/InterprocessIndexer.cpp index a3c6f4bf..a0c68e60 100644 --- a/src/lib/data/indexer/interprocess/InterprocessIndexer.cpp +++ b/src/lib/data/indexer/interprocess/InterprocessIndexer.cpp @@ -18,7 +18,7 @@ InterprocessIndexer::InterprocessIndexer(const std::string& uuid, Id processId) void InterprocessIndexer::work() { - bool updaterThreadRunning = false; + bool updaterThreadRunning = true; std::shared_ptr updaterThread; std::shared_ptr indexer; @@ -29,10 +29,10 @@ void InterprocessIndexer::work() updaterThread = std::make_shared([&]() { - updaterThreadRunning = true; while (updaterThreadRunning) { std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + if (m_interprocessIndexingStatusManager.getIndexingInterrupted()) { LOG_INFO("received indexer interrupt command.");