mirror of https://github.com/apache/lucene.git
LUCENE-1766: document IndexReader/Searcher's thread safety as well
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@799011 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
afb517e832
commit
9f12a2be6b
|
@ -67,6 +67,14 @@ import java.util.Map;
|
|||
if you want to make changes with the resulting IndexReader.
|
||||
</p>
|
||||
|
||||
<a name="thread-safety"></a><p><b>NOTE</b>: {@link
|
||||
<code>IndexReader</code>} instances are completely thread
|
||||
safe, meaning multiple threads can call any of its methods,
|
||||
concurrently. If your application requires external
|
||||
synchronization, you should <b>not</b> synchronize on the
|
||||
<code>IndexReader</code> instance; use your own
|
||||
(non-Lucene) objects instead.
|
||||
|
||||
@version $Id$
|
||||
*/
|
||||
public abstract class IndexReader implements Cloneable {
|
||||
|
|
|
@ -191,10 +191,10 @@ import java.util.Map;
|
|||
<code>IndexWriter</code>} instances are completely thread
|
||||
safe, meaning multiple threads can call any of its
|
||||
methods, concurrently. If your application requires
|
||||
external synchronization, you should <b>not</b> use the
|
||||
<code>IndexWriter</code> instance for synchronization as
|
||||
this can lead to deadlock. Use a private
|
||||
<code>Object</code> instead. </p>
|
||||
external synchronization, you should <b>not</b>
|
||||
synchronize on the <code>IndexWriter</code> instance as
|
||||
this may cause deadlock; use your own (non-Lucene) objects
|
||||
instead. </p>
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -36,6 +36,14 @@ import org.apache.lucene.store.Directory;
|
|||
*
|
||||
* <p>Note that you can only access Hits from an IndexSearcher as long as it is
|
||||
* not yet closed, otherwise an IOException will be thrown.
|
||||
*
|
||||
* <a name="thread-safety"></a><p><b>NOTE</b>: {@link
|
||||
* <code>IndexSearcher</code>} instances are completely
|
||||
* thread safe, meaning multiple threads can call any of its
|
||||
* methods, concurrently. If your application requires
|
||||
* external synchronization, you should <b>not</b>
|
||||
* synchronize on the <code>IndexSearcher</code> instance;
|
||||
* use your own (non-Lucene) objects instead.</p>
|
||||
*/
|
||||
public class IndexSearcher extends Searcher {
|
||||
IndexReader reader;
|
||||
|
|
Loading…
Reference in New Issue