From 4915dcc3f3fd14de88376adc7a7c67c6404cfb1a Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Tue, 27 Sep 2011 17:21:54 +0000 Subject: [PATCH] LUCENE-3471: move comment up git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1176479 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/src/java/org/apache/lucene/search/IndexSearcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lucene/src/java/org/apache/lucene/search/IndexSearcher.java b/lucene/src/java/org/apache/lucene/search/IndexSearcher.java index 838993fab44..0073c62266d 100644 --- a/lucene/src/java/org/apache/lucene/search/IndexSearcher.java +++ b/lucene/src/java/org/apache/lucene/search/IndexSearcher.java @@ -752,11 +752,11 @@ public class IndexSearcher implements Closeable { public TopDocs call() throws IOException { final TopDocs docs = searcher.search (slice.leaves, weight, filter, after, nDocs); final ScoreDoc[] scoreDocs = docs.scoreDocs; + //it would be so nice if we had a thread-safe insert lock.lock(); try { for (int j = 0; j < scoreDocs.length; j++) { // merge scoreDocs into hq final ScoreDoc scoreDoc = scoreDocs[j]; - //it would be so nice if we had a thread-safe insert if (scoreDoc == hq.insertWithOverflow(scoreDoc)) { break; }