- Changed code to use IndexWriter.WRITE_LOCK_NAME.

- Cleaned up indentation a bit.


git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150096 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Otis Gospodnetic 2003-10-13 14:25:54 +00:00
parent 9e968c9127
commit 485e3c336f
1 changed files with 28 additions and 22 deletions

View File

@ -68,6 +68,11 @@ import org.apache.lucene.store.Lock;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BitVector;
/**
* FIXME: Describe class <code>SegmentReader</code> here.
*
* @version $Id$
*/
final class SegmentReader extends IndexReader {
private boolean closeDirectory = false;
private String segment;
@ -132,7 +137,8 @@ final class SegmentReader extends IndexReader {
final synchronized void doClose() throws IOException {
if (deletedDocsDirty) {
synchronized (directory) { // in- & inter-process sync
new Lock.With(directory.makeLock("commit.lock"), IndexWriter.COMMIT_LOCK_TIMEOUT) {
new Lock.With(directory.makeLock("IndexWriter.COMMIT_LOCK_NAME"),
IndexWriter.COMMIT_LOCK_TIMEOUT) {
public Object doBody() throws IOException {
deletedDocs.write(directory, segment + ".tmp");
directory.renameFile(segment + ".tmp", segment + ".del");