jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1055070 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
Date Tue, 04 Jan 2011 14:53:45 GMT
Author: jukka
Date: Tue Jan  4 14:53:45 2011
New Revision: 1055070

URL: http://svn.apache.org/viewvc?rev=1055070&view=rev
Log:
JCR-2836: Unclosed threads in Jackrabbit

Use a per-index timer so we can easily terminate the timer threads

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java?rev=1055070&r1=1055069&r2=1055070&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
Tue Jan  4 14:53:45 2011
@@ -185,7 +185,7 @@ public class MultiIndex {
     /**
      * Timer to schedule flushes of this index after some idle time.
      */
-    private static final Timer FLUSH_TIMER = new Timer(true);
+    private final Timer flushTimer = new Timer(true);
 
     /**
      * Task that is periodically called by {@link #FLUSH_TIMER} and checks
@@ -804,6 +804,7 @@ public class MultiIndex {
         synchronized (this) {
             // stop timer
             flushTask.cancel();
+            flushTimer.cancel();
 
             // commit / close indexes
             try {
@@ -1081,7 +1082,7 @@ public class MultiIndex {
 
     private void scheduleFlushTask() {
         lastFlushTime = System.currentTimeMillis();
-        FLUSH_TIMER.schedule(flushTask, 0, 1000);
+        flushTimer.schedule(flushTask, 0, 1000);
     }
 
     /**



Mime
View raw message