From c2f24277dbc6878b98a5f5174a01b103d16d5bcd Mon Sep 17 00:00:00 2001
From: Liu Hao <lh_mo...@126.com>
Date: Fri, 10 Mar 2017 15:49:35 +0800
Subject: [PATCH 2/2] winpthreads/src/thread.c: Fix SetThreadName().

MSDN says the struct should be passed in as an array of ULONG_PTRs.
Don't use plain DWORD since it causes problems on x64.

Reference: https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx

Signed-off-by: Liu Hao <lh_mo...@126.com>
---
 mingw-w64-libraries/winpthreads/src/thread.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/src/thread.c b/mingw-w64-libraries/winpthreads/src/thread.c
index f847680d..fd213ccf 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -87,12 +87,12 @@ SetThreadName (DWORD dwThreadID, LPCSTR szThreadName)
    info.dwThreadID = dwThreadID;
    info.dwFlags = 0;

-   infosize = sizeof (info) / sizeof (DWORD);
+   infosize = sizeof (info) / sizeof (ULONG_PTR);

 #if defined(_MSC_VER) && !defined (USE_VEH_FOR_MSC_SETTHREADNAME)
    __try
      {
- RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (DWORD *) &info); + RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (ULONG_PTR *)&info);
      }
    __except (EXCEPTION_EXECUTE_HANDLER)
      {
@@ -104,7 +104,7 @@ SetThreadName (DWORD dwThreadID, LPCSTR szThreadName)
    if ((!IsDebuggerPresent ()) && (SetThreadName_VEH_handle == NULL))
      return;

- RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (DWORD *) &info); + RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (ULONG_PTR *) &info);
 #endif
 }

--
2.12.0

From c2f24277dbc6878b98a5f5174a01b103d16d5bcd Mon Sep 17 00:00:00 2001
From: Liu Hao <lh_mo...@126.com>
Date: Fri, 10 Mar 2017 15:49:35 +0800
Subject: [PATCH 2/2] winpthreads/src/thread.c: Fix SetThreadName().

MSDN says the struct should be passed in as an array of ULONG_PTRs.
Don't use plain DWORD since it causes problems on x64.

Reference: https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx

Signed-off-by: Liu Hao <lh_mo...@126.com>
---
 mingw-w64-libraries/winpthreads/src/thread.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/src/thread.c 
b/mingw-w64-libraries/winpthreads/src/thread.c
index f847680d..fd213ccf 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -87,12 +87,12 @@ SetThreadName (DWORD dwThreadID, LPCSTR szThreadName)
    info.dwThreadID = dwThreadID;
    info.dwFlags = 0;
 
-   infosize = sizeof (info) / sizeof (DWORD);
+   infosize = sizeof (info) / sizeof (ULONG_PTR);
 
 #if defined(_MSC_VER) && !defined (USE_VEH_FOR_MSC_SETTHREADNAME)
    __try
      {
-       RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (DWORD *) 
&info);
+       RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (ULONG_PTR 
*)&info);
      }
    __except (EXCEPTION_EXECUTE_HANDLER)
      {
@@ -104,7 +104,7 @@ SetThreadName (DWORD dwThreadID, LPCSTR szThreadName)
    if ((!IsDebuggerPresent ()) && (SetThreadName_VEH_handle == NULL))
      return;
 
-   RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (DWORD *) &info);
+   RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (ULONG_PTR *) 
&info);
 #endif
 }
 
-- 
2.12.0

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to