diff --git a/main.cpp b/main.cpp index a5e2602..0f05ee6 100644 --- a/main.cpp +++ b/main.cpp @@ -60,7 +60,7 @@ class thread_pool public: /* construction & destruction */ - explicit thread_pool(unsigned int); + explicit thread_pool(size_t); ~thread_pool(); /* disallowed operations */ @@ -93,10 +93,10 @@ public: }; -thread_pool::thread_pool(unsigned int thcount): +thread_pool::thread_pool(size_t thcount): fin(false) { - for (int i = 0; i < thcount ; ++i) + for (size_t i = 0; i < thcount ; ++i) workers.emplace_back(&thread_pool::loop, this); } @@ -174,7 +174,7 @@ void thread_pool::add_task(std::function func) 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); }