made small changes to resolve comparison of unsigned and regular ints

This commit is contained in:
Kjistóf 2016-11-12 10:55:22 +01:00
parent 347c0efb96
commit a6b511a2f0

View File

@ -60,7 +60,7 @@ class thread_pool
public: public:
/* construction & destruction */ /* construction & destruction */
explicit thread_pool(unsigned int); explicit thread_pool(size_t);
~thread_pool(); ~thread_pool();
/* disallowed operations */ /* disallowed operations */
@ -93,10 +93,10 @@ public:
}; };
thread_pool::thread_pool(unsigned int thcount): thread_pool::thread_pool(size_t thcount):
fin(false) fin(false)
{ {
for (int i = 0; i < thcount ; ++i) for (size_t i = 0; i < thcount ; ++i)
workers.emplace_back(&thread_pool::loop, this); workers.emplace_back(&thread_pool::loop, this);
} }
@ -174,7 +174,7 @@ void thread_pool::add_task(std::function<void()> func)
void thread_pool::add_thread(size_t num = 1) void thread_pool::add_thread(size_t num = 1)
{ {
for (int i = 0; i < num; ++i) for (size_t i = 0; i < num; ++i)
{ {
workers.emplace_back(&thread_pool::loop, this); workers.emplace_back(&thread_pool::loop, this);
} }