aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2014-04-15 18:29:15 +0000
committerthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2014-04-15 18:29:15 +0000
commitbe38be57e12abac3752e60415c048c0002e5be27 (patch)
treebaa428e7f6cd34c33e936fe4eea63eb475c6e283 /src/common
parent[Android]: Fix hang in CreateChildCrash() on Android. (diff)
downloadbreakpad-be38be57e12abac3752e60415c048c0002e5be27.tar.xz
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
Diffstat (limited to 'src/common')
-rw-r--r--src/common/linux/tests/crash_generator.cc11
1 files changed, 9 insertions, 2 deletions
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 {