From 67fbd40cf72b3d76a14759b06233d1c8a18c673d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 25 Feb 2004 23:14:28 +0000 Subject: [PATCH] don't use GetThreadId --- stepmania/src/archutils/Win32/Crash.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stepmania/src/archutils/Win32/Crash.cpp b/stepmania/src/archutils/Win32/Crash.cpp index 06a23c449f..3a08ca1896 100644 --- a/stepmania/src/archutils/Win32/Crash.cpp +++ b/stepmania/src/archutils/Win32/Crash.cpp @@ -940,12 +940,21 @@ void NORETURN debug_crash() /* Get a stack trace of the current thread and the specified thread. */ void NORETURN Crash_BacktraceThread( HANDLE hThread ) { + if( hThread == NULL ) + { + strcpy( g_CrashInfo.m_CrashReason, "Crash reason: Thread deadlock (with NULL?)" ); + debug_crash(); + } + +#if 0 + /* Ugh. GetThreadId is XP-only or 2003 Server-only or something. How can we do this? */ if( GetThreadId( hThread ) == GetCurrentThreadId() ) { /* hThread is the current thread. This shouldn't happen. */ strcpy( g_CrashInfo.m_CrashReason, "Crash reason: Thread deadlock (with the current thread?)" ); debug_crash(); } +#endif /* Suspend the other thread we're going to backtrace. (We need to at least suspend * hThread, for GetThreadContext to work.) */