From 78d7662c467242277788d44a26d254707f19ae77 Mon Sep 17 00:00:00 2001
From: "Brian S. O'Neill" <bronee@gmail.com>
Date: Wed, 29 Dec 2010 06:20:59 +0000
Subject: Only start old evictor thread if needed.

---
 .../com/amazon/carbonado/util/SoftValuedCache.java | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

(limited to 'src/main')

diff --git a/src/main/java/com/amazon/carbonado/util/SoftValuedCache.java b/src/main/java/com/amazon/carbonado/util/SoftValuedCache.java
index c1562a6..937d379 100644
--- a/src/main/java/com/amazon/carbonado/util/SoftValuedCache.java
+++ b/src/main/java/com/amazon/carbonado/util/SoftValuedCache.java
@@ -128,6 +128,17 @@ public abstract class SoftValuedCache<K, V> {
     private static class Impl<K, V> extends SoftValuedCache<K, V> {
         private static final float LOAD_FACTOR = 0.75f;
 
+        final static Evictor cEvictor;
+
+        static {
+            Evictor evictor = new Evictor();
+            evictor.setName("SoftValuedCache Evictor");
+            evictor.setDaemon(true);
+            evictor.setPriority(Thread.MAX_PRIORITY);
+            evictor.start();
+            cEvictor = evictor;
+        }
+
         private Entry<K, V>[] mEntries;
         private int mSize;
         private int mThreshold;
@@ -400,20 +411,9 @@ public abstract class SoftValuedCache<K, V> {
         }
     }
 
-    final static Evictor cEvictor;
-
-    static {
-        Evictor evictor = new Evictor();
-        evictor.setName("SoftValuedCache Evictor");
-        evictor.setDaemon(true);
-        evictor.setPriority(Thread.MAX_PRIORITY);
-        evictor.start();
-        cEvictor = evictor;
-    }
-
     private static abstract class Ref<T> extends SoftReference<T> {
         Ref(T referent) {
-            super(referent, cEvictor.mQueue);
+            super(referent, Impl.cEvictor.mQueue);
         }
 
         abstract void remove();
-- 
cgit v1.2.3