MCPcopy Create free account
hub / github.com/David-Haim/concurrencpp / thread_pool_executor

Method thread_pool_executor

source/executors/thread_pool_executor.cpp:518–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518thread_pool_executor::thread_pool_executor(std::string_view pool_name,
519 size_t pool_size,
520 std::chrono::milliseconds max_idle_time,
521 const std::function<void(std::string_view thread_name)>& thread_started_callback,
522 const std::function<void(std::string_view thread_name)>& thread_terminated_callback) :
523 derivable_executor<concurrencpp::thread_pool_executor>(pool_name),
524 m_round_robin_cursor(0), m_idle_workers(pool_size), m_abort(false) {
525 m_workers.reserve(pool_size);
526
527 for (size_t i = 0; i < pool_size; i++) {
528 m_workers.emplace_back(*this, i, pool_size, max_idle_time, thread_started_callback, thread_terminated_callback);
529 }
530
531 for (size_t i = 0; i < pool_size; i++) {
532 m_idle_workers.set_idle(i);
533 }
534}
535
536thread_pool_executor::~thread_pool_executor() = default;
537

Callers

nothing calls this directly

Calls 1

set_idleMethod · 0.80

Tested by

no test coverage detected