MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / DestroyThread

Method DestroyThread

Source/Client/NM_Engine/ThreadManagerHelper.cpp:130–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130bool CThreadManager::DestroyThread(const std::shared_ptr <CThread> & thread)
131{
132 if (!IS_VALID_SMART_PTR(thread) || thread->IsCorrect() == false)
133 {
134 DEBUG_LOG(LL_CRI, "Unknown thread! Tid: %u", IS_VALID_SMART_PTR(thread) ? thread->GetId() : (DWORD)-1);
135 return false;
136 }
137
138 if (m_vThreadList.empty())
139 return false;
140
141 for (const auto & pCurrThread : m_vThreadList)
142 {
143 if (pCurrThread->dwThreadId == thread->GetId())
144 {
145 auto threadInfo = GetThreadInfo(pCurrThread->iThreadCode);
146 if (IS_VALID_SMART_PTR(threadInfo))
147 m_vThreadList.erase(std::remove(m_vThreadList.begin(), m_vThreadList.end(), threadInfo), m_vThreadList.end());
148
149 thread->Terminate();
150
151 if (IS_VALID_SMART_PTR(pCurrThread->customThread))
152 {
153 pCurrThread->customThread.reset();
154 pCurrThread->customThread = nullptr;
155 }
156 return true;
157 }
158 }
159
160 return false;
161}
162
163void CThreadManager::OnThreadTerminated(DWORD dwThreadId) // TODO: Implement routine
164{

Callers 11

AntiMacroExFunction · 0.80
SoftBPCheckRoutineFunction · 0.80
NetworkRoutineFunction · 0.80
TimerCheckThreadRoutineFunction · 0.80
NoMercyClientMainRoutineFunction · 0.80
NetQueueWorkerRoutineMethod · 0.80
InitializeWatchdogExFunction · 0.80
ThreadRoutineMethod · 0.80
CheckSectionsHashRoutineFunction · 0.80
InitExThreadTickCheckFunction · 0.80

Calls 7

IsCorrectMethod · 0.80
eraseMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
TerminateMethod · 0.80
resetMethod · 0.80
GetIdMethod · 0.45

Tested by

no test coverage detected