Bug 763410: comment out the code in _PR_MD_SET_CURRENT_THREAD_NAME on MinGW
authorwtc%google.com
Wed, 13 Jun 2012 02:17:05 +0000
changeset 4400 cf97502a1e9345b419156a3e13ee6cc0d4da5dd0
parent 4399 b246f153be4b09aaa3d7df5a2ae42def51112dfe
child 4401 245bb09ea7f5cf4eb74e5b29250157479aa960e9
push idunknown
push userunknown
push dateunknown
bugs763410
Bug 763410: comment out the code in _PR_MD_SET_CURRENT_THREAD_NAME on MinGW because GCC doesn't support SEH __try/__except blocks. The patch is contributed by Jacek Caban <jacek@codeweavers.com>. r=wtc. Modified Files: ntthread.c w95thred.c
pr/src/md/windows/ntthread.c
pr/src/md/windows/w95thred.c
--- a/pr/src/md/windows/ntthread.c
+++ b/pr/src/md/windows/ntthread.c
@@ -286,16 +286,17 @@ typedef struct tagTHREADNAME_INFO
    DWORD dwThreadID; // Thread ID (-1=caller thread).
    DWORD dwFlags; // Reserved for future use, must be zero.
 } THREADNAME_INFO;
 #pragma pack(pop)
 
 void
 _PR_MD_SET_CURRENT_THREAD_NAME(const char *name)
 {
+#ifdef _MSC_VER
    THREADNAME_INFO info;
 
    if (!IsDebuggerPresent())
       return;
 
    info.dwType = 0x1000;
    info.szName = (char*) name;
    info.dwThreadID = -1;
@@ -303,16 +304,17 @@ void
 
    __try {
       RaiseException(MS_VC_EXCEPTION,
                      0,
                      sizeof(info) / sizeof(ULONG_PTR),
                      (ULONG_PTR*)&info);
    } __except(EXCEPTION_CONTINUE_EXECUTION) {
    }
+#endif
 }
 
 void
 _PR_MD_CLEAN_THREAD(PRThread *thread)
 {
     BOOL rv;
 
     if (thread->md.acceptex_buf) {
--- a/pr/src/md/windows/w95thred.c
+++ b/pr/src/md/windows/w95thred.c
@@ -178,16 +178,17 @@ typedef struct tagTHREADNAME_INFO
    DWORD dwThreadID; // Thread ID (-1=caller thread).
    DWORD dwFlags; // Reserved for future use, must be zero.
 } THREADNAME_INFO;
 #pragma pack(pop)
 
 void
 _PR_MD_SET_CURRENT_THREAD_NAME(const char *name)
 {
+#ifdef _MSC_VER
    THREADNAME_INFO info;
 
    if (!IsDebuggerPresent())
       return;
 
    info.dwType = 0x1000;
    info.szName = (char*) name;
    info.dwThreadID = -1;
@@ -195,16 +196,17 @@ void
 
    __try {
       RaiseException(MS_VC_EXCEPTION,
                      0,
                      sizeof(info) / sizeof(ULONG_PTR),
                      (ULONG_PTR*)&info);
    } __except(EXCEPTION_CONTINUE_EXECUTION) {
    }
+#endif
 }
 
 void
 _PR_MD_CLEAN_THREAD(PRThread *thread)
 {
     BOOL rv;
 
     if (thread->md.blocked_sema) {