| 119 | } |
| 120 | |
| 121 | void ThreadPool::enqueue(TASK* taskp, int index) { |
| 122 | auto& task = *taskp; |
| 123 | if (1 >= task.second || 0 > index) { |
| 124 | for (int i = 0; i < task.second; ++i) { |
| 125 | task.first(i); |
| 126 | } |
| 127 | return; |
| 128 | } |
| 129 | enqueueInternal(taskp, index); |
| 130 | } |
| 131 | void ThreadPool::enqueueInternal(TASK* taskp, int index) { |
| 132 | auto& task = *taskp; |
| 133 | if (mActiveCount == 0) { |
no outgoing calls
no test coverage detected