aboutsummaryrefslogtreecommitdiff
path: root/xsig
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-19 16:20:13 -0400
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-19 16:20:13 -0400
commit817075ec9bd6bd656a4a6dc23363e950474b21d5 (patch)
treedf5e35dc9a4a61529872d4be91f6c1f1dae51c01 /xsig
parentbbe461a515ff55cd6733ec0392b0a4f664499ecf (diff)
downloaddeduper-817075ec9bd6bd656a4a6dc23363e950474b21d5.tar.xz
Appease clang analyzer.
Diffstat (limited to 'xsig')
-rw-r--r--xsig/src/thread_pool.hpp8
1 files changed, 4 insertions, 4 deletions
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<void(int)> *f;
+ std::function<void(int)> *f = nullptr;
while(wq.size())
{
wq.pop(f);
@@ -115,7 +115,7 @@ public:
void terminate()
{
stop = true;
- std::function<void(int)> *f;
+ std::function<void(int)> *f = nullptr;
while(wq.size())
{
wq.pop(f);
@@ -139,9 +139,9 @@ private:
std::vector<std::unique_ptr<std::thread>> thr;
std::vector<std::shared_ptr<std::atomic<bool>>> thstop;
_atomic_queue<std::function<void(int)>*> wq;
- std::atomic<bool> wait_interrupt;
- std::atomic<bool> stop;
std::atomic<int> waiting_threads;
+ std::atomic<bool> stop;
+ std::atomic<bool> wait_interrupt;
std::mutex mtx;
std::condition_variable cv;
};