MCPcopy Create free account
hub / github.com/Tencent/tgfx / checkThreads

Method checkThreads

src/core/utils/TaskGroup.cpp:92–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92bool 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
109bool TaskGroup::pushTask(std::shared_ptr<Task> task, TaskPriority priority) {
110#ifndef TGFX_USE_THREADS

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected