From be285f868d6e2eab73cba764ccdeeb88f65b6b8a Mon Sep 17 00:00:00 2001 From: Subhagato Dutta Date: Thu, 12 Jul 2018 20:06:16 -0700 Subject: [PATCH] Fixed clang -Wall warnings --- include/ThreadPool.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ThreadPool.h b/include/ThreadPool.h index b7bf84d..fb21559 100644 --- a/include/ThreadPool.h +++ b/include/ThreadPool.h @@ -18,7 +18,7 @@ class ThreadPool { ThreadPool * m_pool; public: ThreadWorker(ThreadPool * pool, const int id) - : m_pool(pool), m_id(id) { + : m_id(id), m_pool(pool) { } void operator()() { @@ -39,9 +39,9 @@ class ThreadPool { } }; + std::vector m_threads; bool m_shutdown; SafeQueue> m_queue; - std::vector m_threads; std::mutex m_conditional_mutex; std::condition_variable m_conditional_lock; public: @@ -57,7 +57,7 @@ class ThreadPool { // Inits thread pool void init() { - for (int i = 0; i < m_threads.size(); ++i) { + for (size_t i = 0; i < m_threads.size(); ++i) { m_threads[i] = std::thread(ThreadWorker(this, i)); } } @@ -67,7 +67,7 @@ class ThreadPool { m_shutdown = true; m_conditional_lock.notify_all(); - for (int i = 0; i < m_threads.size(); ++i) { + for (size_t i = 0; i < m_threads.size(); ++i) { if(m_threads[i].joinable()) { m_threads[i].join(); }