Increase num tries before failing.
Bug: 128872105
Test: Ran the android_mallopt.set_allocation_limit_multiple_threads test
Test: a thousand times on taimen.
Change-Id: I67a474c53cd6eda8106feac99aee8e7b0bee1254
diff --git a/libc/bionic/malloc_limit.cpp b/libc/bionic/malloc_limit.cpp
index b7e2146..69a8f89 100644
--- a/libc/bionic/malloc_limit.cpp
+++ b/libc/bionic/malloc_limit.cpp
@@ -275,7 +275,7 @@
// being called, allow up to five ms for the signal handler to complete
// before failing.
bool enabled = false;
- size_t max_tries = 5;
+ size_t num_tries = 10;
while (true) {
if (!atomic_exchange(&gGlobalsMutating, true)) {
__libc_globals.mutate([](libc_globals* globals) {
@@ -285,7 +285,7 @@
enabled = true;
break;
}
- if (--max_tries == 0) {
+ if (--num_tries == 0) {
break;
}
usleep(1000);