LUCENE-843: add missing 'synchronized' to allThreadsIdle() method

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@553854 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2007-07-06 11:57:18 +00:00
parent 3e1a31748e
commit 4db9625e28
1 changed files with 2 additions and 2 deletions

View File

@ -363,7 +363,7 @@ final class DocumentsWriter {
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 @@ final class DocumentsWriter {
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);
}