MCPcopy Create free account
hub / github.com/baidu/babylon / enqueue_task

Method enqueue_task

src/babylon/executor.cpp:210–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210int ThreadPoolExecutor::enqueue_task(Task&& task) noexcept {
211 if (is_running_in()) {
212 if (_local_capacity > 0) {
213 auto& local_queue = _local_task_queues.local();
214 if (local_queue.size() < _local_capacity) {
215 local_queue.push<false, false, false>(::std::move(task));
216 return 0;
217 }
218 }
219 }
220 _global_task_queue.push<true, false, true>(::std::move(task));
221 return 0;
222}
223// ThreadPoolExecutor end
224////////////////////////////////////////////////////////////////////////////////
225

Callers

nothing calls this directly

Calls 2

localMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected