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

Method enqueue_foreign

source/executors/worker_thread_executor.cpp:104–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void worker_thread_executor::enqueue_foreign(concurrencpp::task& task) {
105 std::unique_lock<std::mutex> lock(m_lock);
106 if (m_abort) {
107 details::throw_runtime_shutdown_exception(name);
108 }
109
110 const auto is_empty = m_public_queue.empty();
111 m_public_queue.emplace_back(std::move(task));
112
113 if (!m_thread.joinable()) {
114 return make_os_worker_thread();
115 }
116
117 lock.unlock();
118
119 if (is_empty) {
120 m_semaphore.release();
121 }
122}
123
124void worker_thread_executor::enqueue_foreign(std::span<concurrencpp::task> tasks) {
125 std::unique_lock<std::mutex> lock(m_lock);

Callers

nothing calls this directly

Calls 6

joinableMethod · 0.80
unlockMethod · 0.80
releaseMethod · 0.80
endMethod · 0.80
beginMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected