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

Method removeThread

src/Cafe/OS/libs/coreinit/coreinit_ThreadQueue.cpp:111–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 }
110
111 void OSThreadQueueInternal::removeThread(OSThread_t* thread, OSThreadLink* threadLink)
112 {
113 cemu_assert_debug(__OSHasSchedulerLock());
114 size_t linkOffset = getLinkOffset(thread, threadLink);
115 _debugCheckChain(thread, threadLink);
116 if (threadLink->prev)
117 _getThreadLink(threadLink->prev.GetPtr(), linkOffset)->next = threadLink->next;
118 else
119 head = threadLink->next;
120 if (threadLink->next)
121 _getThreadLink(threadLink->next.GetPtr(), linkOffset)->prev = threadLink->prev;
122 else
123 tail = threadLink->prev;
124
125 threadLink->next = nullptr;
126 threadLink->prev = nullptr;
127 }
128
129 // counterpart for queueAndWait
130 // if reschedule is true then scheduler will switch to woken up thread (if it is runnable on the same core)

Callers 3

cancelWaitMethod · 0.95
__OSDeactivateThreadFunction · 0.80

Calls 3

cemu_assert_debugFunction · 0.85
__OSHasSchedulerLockFunction · 0.85
GetPtrMethod · 0.45

Tested by

no test coverage detected