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

Method retire_worker

source/executors/thread_executor.cpp:80–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void thread_executor::retire_worker(std::list<details::thread>::iterator it) {
81 std::unique_lock<std::mutex> lock(m_lock);
82 auto last_retired = std::move(m_last_retired);
83 m_last_retired.splice(m_last_retired.begin(), m_workers, it);
84
85 lock.unlock();
86 m_condition.notify_one();
87
88 if (last_retired.empty()) {
89 return;
90 }
91
92 assert(last_retired.size() == 1);
93 last_retired.front().join();
94}

Callers

nothing calls this directly

Calls 6

beginMethod · 0.80
unlockMethod · 0.80
notify_oneMethod · 0.80
joinMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected