From 9f12a2be6be76efa2d75fe92dccb29be836d6382 Mon Sep 17 00:00:00 2001
From: Michael McCandless
NOTE: {@link
+ IndexReader
} instances are completely thread
+ safe, meaning multiple threads can call any of its methods,
+ concurrently. If your application requires external
+ synchronization, you should not synchronize on the
+ IndexReader
instance; use your own
+ (non-Lucene) objects instead.
+
@version $Id$
*/
public abstract class IndexReader implements Cloneable {
diff --git a/src/java/org/apache/lucene/index/IndexWriter.java b/src/java/org/apache/lucene/index/IndexWriter.java
index e8c27960cf0..c28d74f62bc 100644
--- a/src/java/org/apache/lucene/index/IndexWriter.java
+++ b/src/java/org/apache/lucene/index/IndexWriter.java
@@ -191,10 +191,10 @@ import java.util.Map;
IndexWriter
} instances are completely thread
safe, meaning multiple threads can call any of its
methods, concurrently. If your application requires
- external synchronization, you should not use the
- IndexWriter
instance for synchronization as
- this can lead to deadlock. Use a private
- Object
instead.
IndexWriter
instance as
+ this may cause deadlock; use your own (non-Lucene) objects
+ instead.
*/
/*
diff --git a/src/java/org/apache/lucene/search/IndexSearcher.java b/src/java/org/apache/lucene/search/IndexSearcher.java
index 482760a4a1e..f9690c75657 100644
--- a/src/java/org/apache/lucene/search/IndexSearcher.java
+++ b/src/java/org/apache/lucene/search/IndexSearcher.java
@@ -36,6 +36,14 @@ import org.apache.lucene.store.Directory;
*
* Note that you can only access Hits from an IndexSearcher as long as it is * not yet closed, otherwise an IOException will be thrown. + * + *
NOTE: {@link
+ * IndexSearcher
} instances are completely
+ * thread safe, meaning multiple threads can call any of its
+ * methods, concurrently. If your application requires
+ * external synchronization, you should not
+ * synchronize on the IndexSearcher
instance;
+ * use your own (non-Lucene) objects instead.