Skip to content

About the Constructor #2

Open
Open

Description

@F-jie

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(); })); } }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions