Address compiler warnings #10
All checks were successful
BlockStorage/repertory_osx_builds/pipeline/head This commit looks good
BlockStorage/repertory_linux_builds/pipeline/head This commit looks good

This commit is contained in:
2023-11-08 19:53:12 -06:00
parent a7209184c8
commit f2c1f64f02
30 changed files with 737 additions and 615 deletions

View File

@ -56,11 +56,17 @@ private:
~pool() { shutdown(); }
public:
pool(const pool &) = delete;
pool(pool &&) = delete;
auto operator=(const pool &) -> pool & = delete;
auto operator=(pool &&) -> pool & = delete;
private:
std::vector<std::unique_ptr<work_queue>> pool_queues_;
std::vector<std::thread> pool_threads_;
bool shutdown_ = false;
std::atomic<std::uint8_t> thread_index_;
bool shutdown_{false};
std::atomic<std::uint8_t> thread_index_{};
public:
void execute(std::uint64_t thread_id, const worker_callback &worker,
@ -70,17 +76,26 @@ private:
};
public:
explicit client_pool(std::uint8_t pool_size = 10u)
: pool_size_(pool_size ? pool_size : 10u) {}
explicit client_pool(std::uint8_t pool_size = min_pool_size)
: pool_size_(pool_size == 0U ? min_pool_size : pool_size) {}
~client_pool() { shutdown(); }
public:
client_pool(const client_pool &) = delete;
client_pool(client_pool &&) = delete;
auto operator=(const client_pool &) -> client_pool & = delete;
auto operator=(client_pool &&) -> client_pool & = delete;
private:
const std::uint8_t pool_size_;
std::uint8_t pool_size_;
std::unordered_map<std::string, std::shared_ptr<pool>> pool_lookup_;
std::mutex pool_mutex_;
bool shutdown_ = false;
private:
static constexpr const auto min_pool_size = 10U;
public:
void execute(const std::string &client_id, std::uint64_t thread_id,
const worker_callback &worker,