From be38be57e12abac3752e60415c048c0002e5be27 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Tue, 15 Apr 2014 18:29:15 +0000 Subject: Limit the workaround in r1313 to Android only. BUG=579 R=rmcilroy@chromium.org, vapier@chromium.org Review URL: https://breakpad.appspot.com/1564002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1314 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/linux/tests/crash_generator.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/common/linux/tests/crash_generator.cc') diff --git a/src/common/linux/tests/crash_generator.cc b/src/common/linux/tests/crash_generator.cc index 4e9e6eaf..c9491f6f 100644 --- a/src/common/linux/tests/crash_generator.cc +++ b/src/common/linux/tests/crash_generator.cc @@ -203,7 +203,14 @@ bool CrashGenerator::CreateChildCrash( // tkill returns '0'. Retry a couple of times if the signal doesn't get // through on the first go: // https://code.google.com/p/google-breakpad/issues/detail?id=579 - for (int i = 0; i < 60; i++) { +#if defined(__ANDROID__) + const int kRetries = 60; + const unsigned int kSleepTimeInSeconds = 1; +#else + const int kRetries = 1; + const unsigned int kSleepTimeInSeconds = 600; +#endif + for (int i = 0; i < kRetries; i++) { if (tkill(*GetThreadIdPointer(crash_thread), crash_signal) == -1) { perror("CrashGenerator: Failed to kill thread by signal"); } else { @@ -216,7 +223,7 @@ bool CrashGenerator::CreateChildCrash( // really poll and wait for the kernel to declare the signal has been // delivered. If it has, and things worked, we'd be killed, so the // sleep length doesn't really matter. - sleep(1); + sleep(kSleepTimeInSeconds); } } } else { -- cgit v1.2.1