| 90 | } |
| 91 | |
| 92 | bool TaskGroup::checkThreads() { |
| 93 | if (waitingThreads == 0 && totalThreads < maxThreads) { |
| 94 | auto thread = new (std::nothrow) std::thread(TaskGroup::RunLoop, this); |
| 95 | if (thread) { |
| 96 | if (threads->enqueue(thread)) { |
| 97 | ++totalThreads; |
| 98 | } else { |
| 99 | delete thread; |
| 100 | return false; |
| 101 | } |
| 102 | } |
| 103 | } else { |
| 104 | return true; |
| 105 | } |
| 106 | return totalThreads > 0; |
| 107 | } |
| 108 | |
| 109 | bool TaskGroup::pushTask(std::shared_ptr<Task> task, TaskPriority priority) { |
| 110 | #ifndef TGFX_USE_THREADS |
nothing calls this directly
no outgoing calls
no test coverage detected