From 2e37574fc8f942c5e7fa2ba9af038e1e37643b4e Mon Sep 17 00:00:00 2001 From: gaoyuelong <1569532611@qq.com> Date: Sun, 23 Jul 2023 07:25:41 +0800 Subject: [PATCH] thread_routine_ function catch utils::TimeoutException --- cpp_utils/src/cpp/thread_pool/pool/SlotThreadPool.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp_utils/src/cpp/thread_pool/pool/SlotThreadPool.cpp b/cpp_utils/src/cpp/thread_pool/pool/SlotThreadPool.cpp index 10ad6154..77c2561a 100644 --- a/cpp_utils/src/cpp/thread_pool/pool/SlotThreadPool.cpp +++ b/cpp_utils/src/cpp/thread_pool/pool/SlotThreadPool.cpp @@ -153,6 +153,10 @@ void SlotThreadPool::thread_routine_() { logDebug(UTILS_THREAD_POOL, "Stopping thread: " << std::this_thread::get_id() << "."); } + catch (const utils::TimeoutException& e) + { + logDebug(UTILS_THREAD_POOL, "Timeout. Stopping thread: " << std::this_thread::get_id() << "."); + } } } /* namespace utils */