diff options
author | Alasdair Campbell <alcoheca@gmail.com> | 2012-06-06 19:22:09 +0100 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2014-05-17 09:53:07 +0200 |
commit | e8af954923d374303564863c8fe6a41499bf43c5 (patch) | |
tree | beeaba4a821e056921206f8ff5c4645f59ebccb6 /lib/libUPnP | |
parent | 60f546b6f4a54a399a0cd0cece84486b7018c477 (diff) |
platinum: make sure Neptune threads are named
Diffstat (limited to 'lib/libUPnP')
-rw-r--r-- | lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp index 9666a4cd22..8de7d7469a 100644 --- a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp +++ b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp @@ -521,6 +521,28 @@ NPT_Win32Thread::EntryPoint(void* argument) NPT_System::GetCurrentTimeStamp(now); NPT_System::SetRandomSeed((NPT_UInt32)(now.ToNanos()) + ::GetCurrentThreadId()); + // set a default name + #pragma pack(push,8) + struct THREADNAME_INFO + { + DWORD dwType; // must be 0x1000 + LPCSTR szName; // pointer to name (in same addr space) + DWORD dwThreadID; // thread ID (-1 caller thread) + DWORD dwFlags; // reserved for future use, most be zero + } info; + #pragma pack(pop) + info.dwType = 0x1000; + info.szName = "Neptune Thread"; + info.dwThreadID = GetCurrentThreadId(); + info.dwFlags = 0; + __try + { + RaiseException(0x406d1388, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR *)&info); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + } + // run the thread thread->Run(); |