From ad7edc7b2798c8363e30e38df519172a7d9f86d3 Mon Sep 17 00:00:00 2001 From: Changbin Park Date: Thu, 3 Nov 2022 23:23:45 +0900 Subject: [PATCH] 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 --- httplib.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/httplib.h b/httplib.h index 12c7b85..761481b 100644 --- a/httplib.h +++ b/httplib.h @@ -560,10 +560,9 @@ public: { std::unique_lock lock(mutex_); shutdown_ = true; + cond_.notify_all(); } - cond_.notify_all(); - // Join... for (auto &t : threads_) { t.join();