diff options
author | Carl Shapiro <cshapiro@google.com> | 2011-03-30 19:45:58 -0700 |
---|---|---|
committer | Carl Shapiro <cshapiro@google.com> | 2011-03-30 20:00:38 -0700 |
commit | 55d86d85b3cd11461ba793cdc8ed74c87311a447 (patch) | |
tree | 1fa36a220388ae1c3cb10cb26c66a4bff8fd137f /dalvik | |
parent | a01bdd4dca943bbae7fe63cf76c522bae763a15c (diff) | |
download | libcore-55d86d85b3cd11461ba793cdc8ed74c87311a447.zip libcore-55d86d85b3cd11461ba793cdc8ed74c87311a447.tar.gz libcore-55d86d85b3cd11461ba793cdc8ed74c87311a447.tar.bz2 |
Implement reference queuing in managed code.
This change adds a thread to the core library which receives a list of
references after a garbage collection and enqueues each element. This
list is constructed by linking together the pendingNext field of cleared
references into a circular queue.
To support this change, the pendingNext field has been replaced by the
new zombie field for the purposes of providing a strongly reachable
location within a FinalizerReference class instance.
Change-Id: Id09133e44c850797e7f14c5471123a036d027c80
Diffstat (limited to 'dalvik')
-rw-r--r-- | dalvik/src/main/java/dalvik/system/Zygote.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/dalvik/src/main/java/dalvik/system/Zygote.java b/dalvik/src/main/java/dalvik/system/Zygote.java index 791460b..1cdc52c 100644 --- a/dalvik/src/main/java/dalvik/system/Zygote.java +++ b/dalvik/src/main/java/dalvik/system/Zygote.java @@ -17,6 +17,7 @@ package dalvik.system; import java.lang.FinalizerThread; +import java.lang.ref.ReferenceQueueThread; /** * Provides access to the Dalvik "zygote" feature, which allows a VM instance to @@ -48,10 +49,12 @@ public class Zygote { private Zygote() {} private static void preFork() { + ReferenceQueueThread.stopReferenceQueue(); FinalizerThread.stopFinalizer(); } private static void postFork() { + ReferenceQueueThread.startReferenceQueue(); FinalizerThread.startFinalizer(); } |