Merge pull request #26220 from 78andyp/blurayfixes
[xbmc.git] / lib / libUPnP / patches / 0004-platinum-make-sure-Neptune-threads-are-named.patch
blob8279e19cc78b8ef9dab2ecf04a51a6c57a898bf2
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
6 ---
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
21 + {
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
26 + } info;
27 + #pragma pack(pop)
28 + info.dwType = 0x1000;
29 + info.szName = "Neptune Thread";
30 + info.dwThreadID = GetCurrentThreadId();
31 + info.dwFlags = 0;
32 + __try
33 + {
34 + RaiseException(0x406d1388, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR *)&info);
35 + }
36 + __except(EXCEPTION_EXECUTE_HANDLER)
37 + {
38 + }
40 thread->m_ThreadId = (DWORD)::GetCurrentThreadId();
42 // run the thread
43 --
44 1.7.11.msysgit.0