MCPcopy Create free account
hub / github.com/CasparCG/server / SetThreadName

Function SetThreadName

src/common/os/windows/thread.cpp:19–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17} THREADNAME_INFO;
18
19inline void SetThreadName(DWORD dwThreadID, LPCSTR szThreadName)
20{
21 THREADNAME_INFO info;
22 {
23 info.dwType = 0x1000;
24 info.szName = szThreadName;
25 info.dwThreadID = dwThreadID;
26 info.dwFlags = 0;
27 }
28 __try {
29 RaiseException(0x406D1388, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info);
30 } __except (EXCEPTION_CONTINUE_EXECUTION) {
31 }
32}
33
34void set_thread_name(const std::wstring& name) { SetThreadName(GetCurrentThreadId(), u8(name).c_str()); }
35

Callers 1

set_thread_nameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected