MCPcopy Create free account
hub / github.com/cemu-project/Cemu / __OSIsThreadActive

Function __OSIsThreadActive

src/Cafe/OS/libs/coreinit/coreinit_Thread.cpp:165–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163 }
164
165 bool __OSIsThreadActive(OSThread_t* thread)
166 {
167 cemu_assert_debug(__OSHasSchedulerLock());
168 MPTR threadMPTR = memory_getVirtualOffsetFromPointer(thread);
169 srwlock_activeThreadList.LockWrite();
170 bool isRunable = false;
171 for (sint32 i = 0; i < activeThreadCount; i++)
172 {
173 if (activeThread[i] == threadMPTR)
174 {
175 srwlock_activeThreadList.UnlockWrite();
176 return true;
177 }
178 }
179 srwlock_activeThreadList.UnlockWrite();
180 return false;
181 }
182
183 // thread
184 OSThread_t* __currentCoreThread[3] = {};

Calls 5

cemu_assert_debugFunction · 0.85
__OSHasSchedulerLockFunction · 0.85
LockWriteMethod · 0.45
UnlockWriteMethod · 0.45

Tested by

no test coverage detected