1 From e8af954923d374303564863c8fe6a41499bf43c5 Mon Sep 17 00:00:00 2001
2 From: Alasdair Campbell <alcoheca@gmail.com>
3 Date: Wed, 6 Jun 2012 19:22:09 +0100
4 Subject: [PATCH 04/24] platinum: make sure Neptune threads are named
7 .../Source/System/Win32/NptWin32Threads.cpp | 22 ++++++++++++++++++++++
8 1 file changed, 22 insertions(+)
10 diff --git a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp
11 index 9666a4c..8de7d74 100644
12 --- a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp
13 +++ b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Threads.cpp
14 @@ -525,6 +525,28 @@ NPT_Win32Thread::EntryPoint(void* argument)
15 NPT_System::GetCurrentTimeStamp(now);
16 NPT_System::SetRandomSeed((NPT_UInt32)(now.ToNanos()) + ::GetCurrentThreadId());
18 + // set a default name
19 + #pragma pack(push,8)
20 + struct THREADNAME_INFO
22 + DWORD dwType; // must be 0x1000
23 + LPCSTR szName; // pointer to name (in same addr space)
24 + DWORD dwThreadID; // thread ID (-1 caller thread)
25 + DWORD dwFlags; // reserved for future use, most be zero
28 + info.dwType = 0x1000;
29 + info.szName = "Neptune Thread";
30 + info.dwThreadID = GetCurrentThreadId();
34 + RaiseException(0x406d1388, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR *)&info);
36 + __except(EXCEPTION_EXECUTE_HANDLER)
40 thread->m_ThreadId = (DWORD)::GetCurrentThreadId();