arpadboda commented on a change in pull request #746: MINIFICPP-1185 - Remove 
moodycamel::concurrentqueue from threadpool
URL: https://github.com/apache/nifi-minifi-cpp/pull/746#discussion_r400039479
 
 

 ##########
 File path: libminifi/src/utils/ThreadPool.cpp
 ##########
 @@ -64,8 +64,10 @@ void ThreadPool<T>::run_tasks(std::shared_ptr<WorkerThread> 
thread) {
         }
       }
     } else {
-      std::unique_lock<std::mutex> lock(worker_queue_mutex_);
-      tasks_available_.wait(lock);
+      // This means that the threadpool is running, but the ConcurrentQueue is 
stopped -> shouldn't happen
+      if (running_.load()) {
+        std::this_thread::sleep_for(std::chrono::milliseconds(1));
+      }
 
 Review comment:
   There is no logger here. 
   It's not a critical error that worth an exception/dump and it might happen 
during startup/shutdown for a very short time. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to