From 817075ec9bd6bd656a4a6dc23363e950474b21d5 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 19 Sep 2022 16:20:13 -0400 Subject: Appease clang analyzer. --- xsig/src/thread_pool.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xsig/src') diff --git a/xsig/src/thread_pool.hpp b/xsig/src/thread_pool.hpp index 6aea4ec..42b245a 100644 --- a/xsig/src/thread_pool.hpp +++ b/xsig/src/thread_pool.hpp @@ -103,7 +103,7 @@ public: cv.notify_all(); } for(size_t i = 0; i < thr.size(); ++i)if(thr[i]->joinable())thr[i]->join(); - std::function *f; + std::function *f = nullptr; while(wq.size()) { wq.pop(f); @@ -115,7 +115,7 @@ public: void terminate() { stop = true; - std::function *f; + std::function *f = nullptr; while(wq.size()) { wq.pop(f); @@ -139,9 +139,9 @@ private: std::vector> thr; std::vector>> thstop; _atomic_queue*> wq; - std::atomic wait_interrupt; - std::atomic stop; std::atomic waiting_threads; + std::atomic stop; + std::atomic wait_interrupt; std::mutex mtx; std::condition_variable cv; }; -- cgit v1.2.3