MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / create

Method create

3ds/source/thread.cpp:165–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165bool Threads::create(void (*entrypoint)(void*), void* arg, std::optional<size_t> stackSize)
166{
167 auto lockedThreads = threads.lock();
168 if (lockedThreads->first.size() >= Threads::MAX_THREADS) {
169 return false;
170 }
171 s32 prio = 0;
172 svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);
173 Thread thread = threadCreate(entrypoint, arg, stackSize.value_or(DEFAULT_STACK), prio - 1, -2, false);
174
175 if (thread) {
176 lockedThreads->first.emplace_back(thread);
177 lockedThreads->second.emplace_back(threadGetHandle(thread));
178 svcSignalEvent(lockedThreads->second[1]);
179 return true;
180 }
181
182 return false;
183}
184
185void Threads::executeTask(void (*task)(void*), void* arg)
186{

Callers

nothing calls this directly

Calls 3

emplace_backMethod · 0.80
lockMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected