diff options
author | Alasdair Campbell <alcoheca@gmail.com> | 2012-06-06 19:22:09 +0100 |
---|---|---|
committer | Alasdair Campbell <alcoheca@gmail.com> | 2012-09-05 17:43:07 +0100 |
commit | 038e436f87b5438e539a9eaff91e9d470f7debee (patch) | |
tree | c610ea6082554772a27b3e4d3d26c44c173ba20f /lib/libUPnP/Neptune | |
parent | 6b2ce7352bfe9deb58c7bd22ee66ae56303d363e (diff) |
[UPnP] reinstated: 'changed: make sure Neptune threads are named' by elupus @ 42d7b6b9180f634f988e12673de655228233b305
Diffstat (limited to 'lib/libUPnP/Neptune')
-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 bd32fb3191..aca91a1d71 100644 --- a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp +++ b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp @@ -506,6 +506,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(); |