MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / setName

Method setName

physx/source/foundation/src/windows/PsWindowsThread.cpp:316–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316void ThreadImpl::setName(const char* name)
317{
318 getThread(this)->name = name;
319
320 if (getThread(this)->state == _ThreadImpl::Started)
321 {
322 THREADNAME_INFO info;
323 info.dwType = 0x1000;
324 info.szName = name;
325 info.dwThreadID = getThread(this)->threadID;
326 info.dwFlags = 0;
327
328 // C++ Exceptions are disabled for this project, but SEH is not (and cannot be)
329 // http://stackoverflow.com/questions/943087/what-exactly-will-happen-if-i-disable-c-exceptions-in-a-project
330 __try
331 {
332 RaiseException(NS_MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info);
333 }
334 __except (EXCEPTION_EXECUTE_HANDLER)
335 {
336 // this runs if not attached to a debugger (thus not really naming the thread)
337 }
338 }
339}
340
341void ThreadImpl::setPriority(ThreadPriority::Enum prio)
342{

Callers

nothing calls this directly

Calls 1

getThreadFunction · 0.70

Tested by

no test coverage detected