bakaid 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_r396501595
##########
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(0));
Review comment:
If this shouldn't happen, how sleeping for 0 milliseconds will help?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services