szaszm 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_r397169633
 
 

 ##########
 File path: libminifi/include/utils/ThreadPool.h
 ##########
 @@ -303,8 +303,9 @@ class ThreadPool {
    * Drain will notify tasks to stop following notification
    */
   void drain() {
+    worker_queue_.stop();
     while (current_workers_ > 0) {
-      tasks_available_.notify_one();
+      std::this_thread::sleep_for(std::chrono::milliseconds(1));
 
 Review comment:
   Could you add a code comment explaining this, including the fact that this 
is a best-effort solution? It will be helpful to future readers of the code.

----------------------------------------------------------------
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