MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / SetThisThreadName

Function SetThisThreadName

src/shared/util.cpp:270–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270void SetThisThreadName(const QString& s)
271{
272 using SetThreadDescriptionType = HRESULT(HANDLE hThread, PCWSTR lpThreadDescription);
273
274 static SetThreadDescriptionType* SetThreadDescription = [] {
275 SetThreadDescriptionType* p = nullptr;
276
277 env::LibraryPtr kernel32(LoadLibraryW(L"kernel32.dll"));
278 if (!kernel32) {
279 return p;
280 }
281
282 p = reinterpret_cast<SetThreadDescriptionType*>(
283 GetProcAddress(kernel32.get(), "SetThreadDescription"));
284
285 return p;
286 }();
287
288 if (SetThreadDescription) {
289 SetThreadDescription(GetCurrentThread(), s.toStdWString().c_str());
290 }
291}
292
293char shortcutChar(const QAction* a)
294{

Callers 7

threadFunMethod · 0.85
runMethod · 0.85
MainWindowMethod · 0.85
runFunction · 0.85
processMethod · 0.85
runMethod · 0.85
refreshMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected