]> git.cworth.org Git - apitrace/blobdiff - common/os_win32.cpp
Actually set PTHREAD_MUTEX_RECURSIVE attr.
[apitrace] / common / os_win32.cpp
index 7e1a544a163597997130251f0f269ebfb63b2342..7b35ccf8cacf322338fa1107fffc3af40cc6affa 100644 (file)
 namespace os {
 
 
-/* 
- * Trick from http://locklessinc.com/articles/pthreads_on_windows/
- */
-static CRITICAL_SECTION
-criticalSection = {
-    (PCRITICAL_SECTION_DEBUG)-1, -1, 0, 0, 0, 0
-};
-
-
-void
-acquireMutex(void)
-{
-    EnterCriticalSection(&criticalSection);
-}
-
-
-void
-releaseMutex(void)
-{
-    LeaveCriticalSection(&criticalSection);
-}
-
-
 String
 getProcessName(void)
 {
@@ -258,6 +235,10 @@ abort(void)
 }
 
 
+#ifndef DBG_PRINTEXCEPTION_C
+#define DBG_PRINTEXCEPTION_C 0x40010006
+#endif
+
 static PVOID prevExceptionFilter = NULL;
 static void (*gCallback)(void) = NULL;
 
@@ -285,9 +266,11 @@ unhandledExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo)
 
     // Clear direction flag
 #ifdef _MSC_VER
+#ifndef _WIN64
     __asm {
         cld
     };
+#endif
 #else
     asm("cld");
 #endif