lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maxim Khesin <>
Subject IndexWriter q
Date Mon, 08 Mar 2004 19:14:41 GMT
Hi all,
I have seen the following usage in IndexWriter:

synchronized (directory) {              // in- & inter-process sync
     new Lock.With(directory.makeLock(IndexWriter.COMMIT_LOCK_NAME), 
         public Object doBody() throws IOException {
           segmentInfos.write(directory);      // commit before deleting
           deleteSegments(segmentsToDelete);      // delete now-unused 
           return null;

my question is:
It seems that the synchronized (directory) code is redundant, since 
there is already a file-based lock there. Is there a special case that 
synchronized(directory) handles?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message