MCPcopy Create free account
hub / github.com/beefytech/Beef / SetThreadName

Function SetThreadName

BeefySysLib/platform/win/Platform.cpp:2179–2204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2177}
2178
2179static void SetThreadName(DWORD threadId, const char* name)
2180{
2181 const DWORD MS_VC_EXCEPTION = 0x406D1388;
2182
2183 typedef struct tagTHREADNAME_INFO
2184 {
2185 DWORD dwType; // Must be 0x1000.
2186 LPCSTR szName; // Pointer to name (in user addr space).
2187 DWORD dwThreadID; // Thread ID (-1=caller thread).
2188 DWORD dwFlags; // Reserved for future use, must be zero.
2189 } THREADNAME_INFO;
2190
2191 THREADNAME_INFO info;
2192 info.dwType = 0x1000;
2193 info.szName = name;
2194 info.dwThreadID = threadId;
2195 info.dwFlags = 0;
2196
2197 __try
2198 {
2199 RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info);
2200 }
2201 __except (EXCEPTION_EXECUTE_HANDLER)
2202 {
2203 }
2204}
2205
2206BFP_EXPORT void BFP_CALLTYPE BfpThread_SetName(BfpThread* thread, const char* name, BfpThreadResult* outResult)
2207{

Callers 1

BfpThread_SetNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected