MCPcopy Create free account
hub / github.com/UbiquitousLearning/mllm / acquireTaskSlot

Method acquireTaskSlot

mllm/engine/HpcThreadPool.cpp:51–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51int HpcThreadPool::acquireTaskSlot() {
52 std::lock_guard<std::mutex> _l(queue_mutex_);
53 for (int i = 0; i < MLLM_HPC_THREAD_POOL_TASK_LIMITS; ++i) {
54 if (task_available_[i]) {
55 task_available_[i] = false;
56 return i;
57 }
58 }
59 return -1;
60}
61
62void HpcThreadPool::releaseTaskSlot(int task_slot_idx) {
63 if (task_slot_idx < 0 || task_slot_idx >= MLLM_HPC_THREAD_POOL_TASK_LIMITS) { return; }

Callers 1

initThreadPoolMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected