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

Method work_loop

source/executors/thread_pool_executor.cpp:366–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366void thread_pool_worker::work_loop() {
367 s_tl_thread_pool_data.this_worker = this;
368 s_tl_thread_pool_data.this_thread_index = m_index;
369
370 try {
371 while (true) {
372 if (!drain_queue()) {
373 return;
374 }
375 }
376 } catch (const errors::runtime_shutdown&) {
377 std::unique_lock<std::mutex> lock(m_lock);
378 m_idle = true;
379 }
380}
381
382void thread_pool_worker::ensure_worker_active(bool first_enqueuer, std::unique_lock<std::mutex>& lock) {
383 assert(lock.owns_lock());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected