summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Jastrzebski <haaawk@google.com>2015-04-09 07:44:12 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-09 07:44:13 +0000
commit44c7aa355e06ac7a9d46fcd5870b183e4d34d3bf (patch)
tree59938fb39ba4d20342d14942ca99be0c3dedffa1
parent227afa2784b1a78504de22730161b65cc7093fc6 (diff)
parentcea2c6317356b984290ff579d5cde6d2f03668ff (diff)
downloadlibcore-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.java9
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();
}
}
}