ThreadPool icon indicating copy to clipboard operation
ThreadPool copied to clipboard

About the Constructor

Open F-jie opened this issue 5 years ago • 0 comments

why don't you init num_workers_ in the following code: ThreadPool::ThreadPool(const size_t& num_workers) : jobs_left_(0), bailout_(false), finished_(false) { std::unique_lock<std::mutex> worker_lock(worker_mutex_); for (auto i = 0; i < num_workers; ++i) { workers_.emplace_back(std::thread([this] { return this->Run(); })); } }

F-jie avatar Sep 07 '20 01:09 F-jie