Kaynağa Gözat

avoid lockup in `ThreadPool::shutdown()` on legacy host (#1417)

It is found on CentOS 7.0.1406 which is very early version of CentOS 7.

Co-authored-by: Changbin Park <changbin.park@ahnlab.com>
Changbin Park 3 yıl önce
ebeveyn
işleme
ad7edc7b27
1 değiştirilmiş dosya ile 1 ekleme ve 2 silme
  1. 1 2
      httplib.h

+ 1 - 2
httplib.h

@@ -560,10 +560,9 @@ public:
     {
       std::unique_lock<std::mutex> lock(mutex_);
       shutdown_ = true;
+      cond_.notify_all();
     }
 
-    cond_.notify_all();
-
     // Join...
     for (auto &t : threads_) {
       t.join();