lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r553854 - /lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java
Date Fri, 06 Jul 2007 11:57:20 GMT
Author: mikemccand
Date: Fri Jul  6 04:57:18 2007
New Revision: 553854

URL: http://svn.apache.org/viewvc?view=rev&rev=553854
Log:
LUCENE-843: add missing 'synchronized' to allThreadsIdle() method

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java?view=diff&rev=553854&r1=553853&r2=553854
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java Fri Jul  6 04:57:18
2007
@@ -363,7 +363,7 @@
       notifyAll();
   }
 
-  private boolean allThreadsIdle() {
+  private synchronized boolean allThreadsIdle() {
     for(int i=0;i<threadStates.length;i++)
       if (!threadStates[i].isIdle)
         return false;
@@ -2119,8 +2119,8 @@
         ThreadState[] newArray = new ThreadState[1+threadStates.length];
         if (threadStates.length > 0)
           System.arraycopy(threadStates, 0, newArray, 0, threadStates.length);
+        state = newArray[threadStates.length] = new ThreadState();
         threadStates = newArray;
-        state = threadStates[threadStates.length-1] = new ThreadState();
       }
       threadBindings.put(Thread.currentThread(), state);
     }



Mime
View raw message