From a24ae6c5fbb833f3ae4798d82138abb649abc99b Mon Sep 17 00:00:00 2001 From: nijiancong Date: Fri, 23 May 2025 17:16:20 +0800 Subject: [PATCH 1/2] fix: loss notify when HThreadPool::stop() --- cpputil/hthreadpool.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpputil/hthreadpool.h b/cpputil/hthreadpool.h index 8df987178..ae7635b4f 100644 --- a/cpputil/hthreadpool.h +++ b/cpputil/hthreadpool.h @@ -80,7 +80,10 @@ class HThreadPool { int stop() { if (status == STOP) return -1; - status = STOP; + { + std::unique_lock locker(task_mutex); + status = STOP; + } task_cond.notify_all(); for (auto& i : threads) { if (i.thread->joinable()) { From 90882e18829ed3b68d291323c8e43d88471ceb08 Mon Sep 17 00:00:00 2001 From: nijiancong Date: Fri, 23 May 2025 17:57:33 +0800 Subject: [PATCH 2/2] install TimerThread.h --- cmake/vars.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/vars.cmake b/cmake/vars.cmake index 20a6e658d..f8eb938dd 100644 --- a/cmake/vars.cmake +++ b/cmake/vars.cmake @@ -65,6 +65,7 @@ set(EVPP_HEADERS evpp/TcpServer.h evpp/UdpClient.h evpp/UdpServer.h + evpp/TimerThread.h ) set(PROTOCOL_HEADERS