Index: third_party/crashpad/crashpad/handler/win/crash_other_program.cc |
diff --git a/third_party/crashpad/crashpad/handler/win/crash_other_program.cc b/third_party/crashpad/crashpad/handler/win/crash_other_program.cc |
index db532bb5722c22de29ec2443e6ee26b0ac52df2c..d191aac01ed0e1b9df64bdbd681cb9b51d1e9420 100644 |
--- a/third_party/crashpad/crashpad/handler/win/crash_other_program.cc |
+++ b/third_party/crashpad/crashpad/handler/win/crash_other_program.cc |
@@ -46,13 +46,13 @@ bool CrashAndDumpTarget(const CrashpadClient& client, HANDLE process) { |
return false; |
} |
- int thread_count = 0; |
do { |
if (te32.th32OwnerProcessID == target_pid) { |
- thread_count++; |
- if (thread_count == 2) { |
- // Nominate this lucky thread as our blamee, and dump it. This will be |
- // "Thread1" in the child. |
+ // We set the thread priority of "Thread1" to a non-default value before |
+ // going to sleep. Dump and blame this thread. For an explanation of |
+ // "9", see |
+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms685100.aspx. |
+ if (te32.tpBasePri == 9) { |
ScopedKernelHANDLE thread( |
OpenThread(kXPThreadAllAccess, false, te32.th32ThreadID)); |
if (!client.DumpAndCrashTargetProcess( |
@@ -81,11 +81,6 @@ int CrashOtherProgram(int argc, wchar_t* argv[]) { |
return EXIT_FAILURE; |
} |
- if (!client.UseHandler()) { |
- LOG(ERROR) << "UseHandler"; |
- return EXIT_FAILURE; |
- } |
- |
// Launch another process that hangs. |
base::FilePath test_executable = Paths::Executable(); |
std::wstring child_test_executable = |