From 64c6c367497c7fcf88e7527022234043e4460758 Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Mon, 20 Jun 2011 15:08:30 -0700 Subject: Implement the finalizer watchdog. Change-Id: Ia4aaf5f0ef5a2f5f7e6ec3e8b4c4e300c9e1b2ee http://b/4144865 --- dalvik/src/main/java/dalvik/system/VMRuntime.java | 5 +++++ dalvik/src/main/java/dalvik/system/Zygote.java | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'dalvik') diff --git a/dalvik/src/main/java/dalvik/system/VMRuntime.java b/dalvik/src/main/java/dalvik/system/VMRuntime.java index 3e35ecf..1a19d0e 100644 --- a/dalvik/src/main/java/dalvik/system/VMRuntime.java +++ b/dalvik/src/main/java/dalvik/system/VMRuntime.java @@ -203,4 +203,9 @@ public final class VMRuntime { * up to the maximum heap size. */ public native void clearGrowthLimit(); + + /** + * Returns true if either a Java debugger or native debugger is active. + */ + public native boolean isDebuggerActive(); } diff --git a/dalvik/src/main/java/dalvik/system/Zygote.java b/dalvik/src/main/java/dalvik/system/Zygote.java index 336a6d6..fe432a9 100644 --- a/dalvik/src/main/java/dalvik/system/Zygote.java +++ b/dalvik/src/main/java/dalvik/system/Zygote.java @@ -17,8 +17,6 @@ package dalvik.system; import java.io.File; -import java.lang.FinalizerThread; -import java.lang.ref.ReferenceQueueThread; /** * Provides access to the Dalvik "zygote" feature, which allows a VM instance to @@ -50,8 +48,7 @@ public class Zygote { private Zygote() {} private static void preFork() { - ReferenceQueueThread.stopReferenceQueue(); - FinalizerThread.stopFinalizer(); + Daemons.stop(); waitUntilAllThreadsStopped(); } @@ -72,8 +69,7 @@ public class Zygote { } private static void postFork() { - ReferenceQueueThread.startReferenceQueue(); - FinalizerThread.startFinalizer(); + Daemons.start(); } /** -- cgit v1.1