diff options
author | Piotr Jastrzebski <haaawk@google.com> | 2015-04-09 07:44:12 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-09 07:44:13 +0000 |
commit | 44c7aa355e06ac7a9d46fcd5870b183e4d34d3bf (patch) | |
tree | 59938fb39ba4d20342d14942ca99be0c3dedffa1 | |
parent | 227afa2784b1a78504de22730161b65cc7093fc6 (diff) | |
parent | cea2c6317356b984290ff579d5cde6d2f03668ff (diff) | |
download | libcore-44c7aa355e06ac7a9d46fcd5870b183e4d34d3bf.zip libcore-44c7aa355e06ac7a9d46fcd5870b183e4d34d3bf.tar.gz libcore-44c7aa355e06ac7a9d46fcd5870b183e4d34d3bf.tar.bz2 |
Merge "Stop sleeping in waitUntilAllThreadsStopped spin instead."
-rw-r--r-- | dalvik/src/main/java/dalvik/system/ZygoteHooks.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/dalvik/src/main/java/dalvik/system/ZygoteHooks.java b/dalvik/src/main/java/dalvik/system/ZygoteHooks.java index 59d8820..134c2f4 100644 --- a/dalvik/src/main/java/dalvik/system/ZygoteHooks.java +++ b/dalvik/src/main/java/dalvik/system/ZygoteHooks.java @@ -70,13 +70,10 @@ public final class ZygoteHooks { */ private static void waitUntilAllThreadsStopped() { File tasks = new File("/proc/self/task"); + // All Java daemons are stopped already. We're just waiting for their OS counterparts to + // finish as well. This shouldn't take much time so spinning is ok here. while (tasks.list().length > 1) { - try { - // Experimentally, booting and playing about with a stingray, I never saw us - // go round this loop more than once with a 10ms sleep. - Thread.sleep(10); - } catch (InterruptedException ignored) { - } + Thread.yield(); } } } |