LUCENE-8090: Prevent stale threadstate reads in DocumentsWriterFlushControl

This commit is contained in:
Simon Willnauer 2017-12-11 14:45:26 +01:00
parent 952f4c4e59
commit 9ad84fea80
1 changed files with 1 additions and 1 deletions

View File

@ -716,7 +716,7 @@ final class DocumentsWriterFlushControl implements Accountable {
return infoStream;
}
ThreadState findLargestNonPendingWriter() {
synchronized ThreadState findLargestNonPendingWriter() {
ThreadState maxRamUsingThreadState = null;
long maxRamSoFar = 0;
Iterator<ThreadState> activePerThreadsIterator = allActiveThreadStates();