lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [Lucene.Net] svn commit: r1084341 - in /incubator/lucene.net/trunk/C#/src/Lucene.Net/Index: ConcurrentMergeScheduler.cs DirectoryReader.cs
Date Tue, 22 Mar 2011 20:21:44 GMT
Author: digy
Date: Tue Mar 22 20:21:44 2011
New Revision: 1084341

URL: http://svn.apache.org/viewvc?rev=1084341&view=rev
Log:
[LUCENENET-399] The sole case failing is TestIndexWriterReader.TestDuringAddIndexes

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DirectoryReader.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs?rev=1084341&r1=1084340&r2=1084341&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs Tue Mar
22 20:21:44 2011
@@ -173,7 +173,10 @@ namespace Lucene.Net.Index
 		
 		private int MergeThreadCount()
 		{
-            return MergeThreadCount(false);
+            lock (this)
+            {
+                return MergeThreadCount(false);
+            }
 		}
 
         private int MergeThreadCount(bool excludeDone)

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DirectoryReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/DirectoryReader.cs?rev=1084341&r1=1084340&r2=1084341&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DirectoryReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/DirectoryReader.cs Tue Mar 22 20:21:44
2011
@@ -494,7 +494,7 @@ namespace Lucene.Net.Index
             return writer.GetReader();
         }
 
-        private IndexReader DoReopen(bool openReadOnly, IndexCommit commit)
+        internal virtual IndexReader DoReopen(bool openReadOnly, IndexCommit commit)
         {
             EnsureOpen();
 
@@ -576,8 +576,10 @@ namespace Lucene.Net.Index
         {
             DirectoryReader enclosingInstance;
             bool openReadOnly;
-            public AnonymousFindSegmentsFile(Directory dir,bool openReadOnly,DirectoryReader
dirReader) : base(dir)
+            Directory dir;
+            public AnonymousFindSegmentsFile(Directory directory, bool openReadOnly, DirectoryReader
dirReader) : base(directory)
             {
+                this.dir = directory;
                 this.openReadOnly = openReadOnly;
                 enclosingInstance = dirReader;
             }
@@ -585,7 +587,7 @@ namespace Lucene.Net.Index
             public override object DoBody(string segmentFileName)
             {
                 SegmentInfos infos = new SegmentInfos();
-                infos.Read(directory, segmentFileName);
+                infos.Read(this.dir, segmentFileName);
                 return enclosingInstance.DoReopen(infos, false, openReadOnly);
             }
         }



Mime
View raw message