lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: Fix for TestThreadInterruptDeadlock
Date Wed, 25 Feb 2015 22:33:33 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master ac8fa48cb -> 9769e6d5d


Fix for TestThreadInterruptDeadlock

Use the C# ThreadInterruptedException so the catches will properly control the flow during
interruption.
This fixes the two unit tests Lucene.Next.Index.TestIndexWriter.TestThreadInterruptDeadlock
and Lucene.Next.Index.TestIndexWriter.TestTwoThreadsInterruptDeadlock
Lucene uses the ThreadInterruptedException for code flow control so it is important to use
the C# ThreadInterruptedException to avoid duplicating the catch everywhere and preserve the
flow.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/9769e6d5
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/9769e6d5
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/9769e6d5

Branch: refs/heads/master
Commit: 9769e6d5d1c35fc4f7095450bef24fd452caa53f
Parents: ac8fa48
Author: Chand2048 <Chand@Microsoft.com>
Authored: Wed Feb 25 11:26:29 2015 -0800
Committer: Chand2048 <Chand@Microsoft.com>
Committed: Wed Feb 25 11:26:29 2015 -0800

----------------------------------------------------------------------
 .../Index/ConcurrentMergeScheduler.cs           |  5 ++-
 .../Index/DocumentsWriterFlushControl.cs        |  3 +-
 .../Index/DocumentsWriterStallControl.cs        |  4 +--
 src/Lucene.Net.Core/Index/IndexWriter.cs        |  3 +-
 src/Lucene.Net.Core/Lucene.Net.csproj           |  1 -
 .../Search/ControlledRealTimeReopenThread.cs    |  3 +-
 src/Lucene.Net.Core/Search/IndexSearcher.cs     |  2 +-
 .../Search/TimeLimitingCollector.cs             |  3 +-
 src/Lucene.Net.Core/Store/Lock.cs               |  4 +--
 src/Lucene.Net.Core/Store/RateLimiter.cs        |  4 +--
 .../Util/ThreadInterruptedException.cs          | 35 --------------------
 .../Store/SlowClosingMockIndexInputWrapper.cs   |  4 +--
 .../Store/SlowOpeningMockIndexInputWrapper.cs   |  4 +--
 .../Util/ThrottledIndexOutput.cs                |  2 +-
 src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs  |  3 +-
 .../Index/TestDocumentsWriterDeleteQueue.cs     |  4 +--
 .../Index/TestDocumentsWriterStallControl.cs    |  5 ++-
 .../core/Index/TestIndexWriter.cs               |  1 -
 .../core/Index/TestIndexWriterReader.cs         |  4 +--
 .../core/Index/TestIndexWriterWithThreads.cs    |  3 +-
 .../core/Index/TestSnapshotDeletionPolicy.cs    |  3 +-
 src/Lucene.Net.Tests/core/Util/TestSetOnce.cs   |  1 +
 22 files changed, 23 insertions(+), 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Index/ConcurrentMergeScheduler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/ConcurrentMergeScheduler.cs b/src/Lucene.Net.Core/Index/ConcurrentMergeScheduler.cs
index a0b2e4f..5f6bfa3 100644
--- a/src/Lucene.Net.Core/Index/ConcurrentMergeScheduler.cs
+++ b/src/Lucene.Net.Core/Index/ConcurrentMergeScheduler.cs
@@ -26,7 +26,6 @@ namespace Lucene.Net.Index
          */
 
     using Directory = Lucene.Net.Store.Directory;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
 
     /// <summary>
     /// A <seealso cref="MergeScheduler"/> that runs each merge using a
@@ -449,7 +448,7 @@ namespace Lucene.Net.Index
                         }
                         catch (ThreadInterruptedException ie)
                         {
-                            throw new ThreadInterruptedException(ie);
+                            throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
                         }
                     }
 
@@ -714,7 +713,7 @@ namespace Lucene.Net.Index
             }
             catch (ThreadInterruptedException ie)
             {
-                throw new ThreadInterruptedException(ie);
+                throw new ThreadInterruptedException("Thread Interrupted Exception", ie);
             }
             throw new MergePolicy.MergeException(exc, Dir);
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Index/DocumentsWriterFlushControl.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/DocumentsWriterFlushControl.cs b/src/Lucene.Net.Core/Index/DocumentsWriterFlushControl.cs
index 317903e..b516947 100644
--- a/src/Lucene.Net.Core/Index/DocumentsWriterFlushControl.cs
+++ b/src/Lucene.Net.Core/Index/DocumentsWriterFlushControl.cs
@@ -7,7 +7,6 @@ namespace Lucene.Net.Index
 {
     using Lucene.Net.Support;
     using InfoStream = Lucene.Net.Util.InfoStream;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
 
     /*
          * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -303,7 +302,7 @@ namespace Lucene.Net.Index
                     }
                     catch (ThreadInterruptedException e)
                     {
-                        throw new ThreadInterruptedException(e);
+                        throw new ThreadInterruptedException("Thread Interrupted Exception",
e);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Index/DocumentsWriterStallControl.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/DocumentsWriterStallControl.cs b/src/Lucene.Net.Core/Index/DocumentsWriterStallControl.cs
index 04e2601..0ee948c 100644
--- a/src/Lucene.Net.Core/Index/DocumentsWriterStallControl.cs
+++ b/src/Lucene.Net.Core/Index/DocumentsWriterStallControl.cs
@@ -23,8 +23,6 @@ namespace Lucene.Net.Index
          * limitations under the License.
          */
 
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
-
     /// <summary>
     /// Controls the health status of a <seealso cref="DocumentsWriter"/> sessions.
this class
     /// used to block incoming indexing threads if flushing significantly slower than
@@ -89,7 +87,7 @@ namespace Lucene.Net.Index
                         }
                         catch (ThreadInterruptedException e)
                         {
-                            throw new ThreadInterruptedException(e);
+                            throw new ThreadInterruptedException("Thread Interrupted Exception",
e);
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Index/IndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/IndexWriter.cs b/src/Lucene.Net.Core/Index/IndexWriter.cs
index 151577b..fbedd45 100644
--- a/src/Lucene.Net.Core/Index/IndexWriter.cs
+++ b/src/Lucene.Net.Core/Index/IndexWriter.cs
@@ -50,7 +50,6 @@ namespace Lucene.Net.Index
     using MergeInfo = Lucene.Net.Store.MergeInfo;
     using OpenMode_e = Lucene.Net.Index.IndexWriterConfig.OpenMode_e;
     using Query = Lucene.Net.Search.Query;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
     using TrackingDirectoryWrapper = Lucene.Net.Store.TrackingDirectoryWrapper;
 
     /// <summary>
@@ -5365,7 +5364,7 @@ namespace Lucene.Net.Index
                 }
                 catch (ThreadInterruptedException ie)
                 {
-                    throw new ThreadInterruptedException(ie);
+                    throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Lucene.Net.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Lucene.Net.csproj b/src/Lucene.Net.Core/Lucene.Net.csproj
index 141edbe..41e5b32 100644
--- a/src/Lucene.Net.Core/Lucene.Net.csproj
+++ b/src/Lucene.Net.Core/Lucene.Net.csproj
@@ -850,7 +850,6 @@
     <Compile Include="Util\Sorter.cs" />
     <Compile Include="Util\SPIClassIterator.cs" />
     <Compile Include="Util\StringHelper.cs" />
-    <Compile Include="Util\ThreadInterruptedException.cs" />
     <Compile Include="Util\TimSorter.cs" />
     <Compile Include="Util\ToStringUtils.cs" />
     <Compile Include="Util\UnicodeUtil.cs" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Search/ControlledRealTimeReopenThread.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/ControlledRealTimeReopenThread.cs b/src/Lucene.Net.Core/Search/ControlledRealTimeReopenThread.cs
index d5926d3..bf1812b 100644
--- a/src/Lucene.Net.Core/Search/ControlledRealTimeReopenThread.cs
+++ b/src/Lucene.Net.Core/Search/ControlledRealTimeReopenThread.cs
@@ -23,7 +23,6 @@ namespace Lucene.Net.Search
          */
 
     using IndexWriter = Lucene.Net.Index.IndexWriter;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
     using TrackingIndexWriter = Lucene.Net.Index.TrackingIndexWriter;
 
     /// <summary>
@@ -150,7 +149,7 @@ namespace Lucene.Net.Search
                 }
                 catch (ThreadInterruptedException ie)
                 {
-                    throw new ThreadInterruptedException(ie);
+                    throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
                 }
 
                 // Max it out so any waiting search threads will return:

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Search/IndexSearcher.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/IndexSearcher.cs b/src/Lucene.Net.Core/Search/IndexSearcher.cs
index 9bb05a3..241f493 100644
--- a/src/Lucene.Net.Core/Search/IndexSearcher.cs
+++ b/src/Lucene.Net.Core/Search/IndexSearcher.cs
@@ -924,7 +924,7 @@ namespace Lucene.Net.Search
               }
               catch (ThreadInterruptedException e)
               {
-                throw new ThreadInterruptedException(e);
+                throw new ThreadInterruptedException("Thread Interrupted Exception", e);
               }
               catch (ExecutionException e)
               {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Search/TimeLimitingCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/TimeLimitingCollector.cs b/src/Lucene.Net.Core/Search/TimeLimitingCollector.cs
index 4ce23ee..0396c1c 100644
--- a/src/Lucene.Net.Core/Search/TimeLimitingCollector.cs
+++ b/src/Lucene.Net.Core/Search/TimeLimitingCollector.cs
@@ -24,7 +24,6 @@ namespace Lucene.Net.Search
 
     using AtomicReaderContext = Lucene.Net.Index.AtomicReaderContext;
     using Counter = Lucene.Net.Util.Counter;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
 
     /// <summary>
     /// The <seealso cref="TimeLimitingCollector"/> is used to timeout search requests
that
@@ -318,7 +317,7 @@ namespace Lucene.Net.Search
                     }
                     catch (ThreadInterruptedException ie)
                     {
-                        throw new ThreadInterruptedException(ie);
+                        throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Store/Lock.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/Lock.cs b/src/Lucene.Net.Core/Store/Lock.cs
index 722d9fc..ddeb71d 100644
--- a/src/Lucene.Net.Core/Store/Lock.cs
+++ b/src/Lucene.Net.Core/Store/Lock.cs
@@ -20,8 +20,6 @@ namespace Lucene.Net.Store
      * limitations under the License.
      */
 
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
-
     /// <summary>
     /// An interprocess mutex lock.
     /// <p>Typical use might look like:<pre class="prettyprint">
@@ -106,7 +104,7 @@ namespace Lucene.Net.Store
                 }
                 catch (ThreadInterruptedException ie)
                 {
-                    throw new ThreadInterruptedException(ie);
+                    throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
                 }
                 locked = Obtain();
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Store/RateLimiter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/RateLimiter.cs b/src/Lucene.Net.Core/Store/RateLimiter.cs
index 886bd31..2ebe2d7 100644
--- a/src/Lucene.Net.Core/Store/RateLimiter.cs
+++ b/src/Lucene.Net.Core/Store/RateLimiter.cs
@@ -21,8 +21,6 @@ namespace Lucene.Net.Store
          * limitations under the License.
          */
 
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
-
     /// <summary>
     /// Abstract base class to rate limit IO.  Typically implementations are
     ///  shared across multiple IndexInputs or IndexOutputs (for example
@@ -126,7 +124,7 @@ namespace Lucene.Net.Store
                         }
                         catch (ThreadInterruptedException ie)
                         {
-                            throw new ThreadInterruptedException(ie);
+                            throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
                         }
                         curNS = DateTime.UtcNow.Ticks * 100;
                         continue;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Core/Util/ThreadInterruptedException.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/ThreadInterruptedException.cs b/src/Lucene.Net.Core/Util/ThreadInterruptedException.cs
deleted file mode 100644
index cf5ae9e..0000000
--- a/src/Lucene.Net.Core/Util/ThreadInterruptedException.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-
-namespace Lucene.Net.Util
-{
-    /*
-     * Licensed to the Apache Software Foundation (ASF) under one or more
-     * contributor license agreements.  See the NOTICE file distributed with
-     * this work for additional information regarding copyright ownership.
-     * The ASF licenses this file to You under the Apache License, Version 2.0
-     * (the "License"); you may not use this file except in compliance with
-     * the License.  You may obtain a copy of the License at
-     * <p/>
-     * http://www.apache.org/licenses/LICENSE-2.0
-     * <p/>
-     * Unless required by applicable law or agreed to in writing, software
-     * distributed under the License is distributed on an "AS IS" BASIS,
-     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     * See the License for the specific language governing permissions and
-     * limitations under the License.
-     */
-
-    /// <summary>
-    /// Thrown by lucene on detecting that Thread.interrupt() had
-    /// been called.  Unlike Java's InterruptedException, this
-    /// exception is not checked..
-    /// </summary>
-
-    public sealed class ThreadInterruptedException : Exception
-    {
-        public ThreadInterruptedException(Exception ie)
-            : base(ie.ToString(), ie)
-        {
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.TestFramework/Store/SlowClosingMockIndexInputWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Store/SlowClosingMockIndexInputWrapper.cs b/src/Lucene.Net.TestFramework/Store/SlowClosingMockIndexInputWrapper.cs
index 98841e4..52b3a5e 100644
--- a/src/Lucene.Net.TestFramework/Store/SlowClosingMockIndexInputWrapper.cs
+++ b/src/Lucene.Net.TestFramework/Store/SlowClosingMockIndexInputWrapper.cs
@@ -19,8 +19,6 @@ namespace Lucene.Net.Store
      * limitations under the License.
      */
 
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
-
     /// <summary>
     /// hangs onto files a little bit longer (50ms in close).
     /// MockDirectoryWrapper acts like windows: you can't delete files
@@ -42,7 +40,7 @@ namespace Lucene.Net.Store
             }
             catch (ThreadInterruptedException ie)
             {
-                throw new ThreadInterruptedException(ie);
+                throw new ThreadInterruptedException("Thread Interrupted Exception", ie);
             }
             finally
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.TestFramework/Store/SlowOpeningMockIndexInputWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Store/SlowOpeningMockIndexInputWrapper.cs b/src/Lucene.Net.TestFramework/Store/SlowOpeningMockIndexInputWrapper.cs
index 8c82cd9..1829ca4 100644
--- a/src/Lucene.Net.TestFramework/Store/SlowOpeningMockIndexInputWrapper.cs
+++ b/src/Lucene.Net.TestFramework/Store/SlowOpeningMockIndexInputWrapper.cs
@@ -20,8 +20,6 @@ namespace Lucene.Net.Store
      * limitations under the License.
      */
 
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
-
     /// <summary>
     /// Takes a while to open files: gives testThreadInterruptDeadlock
     /// a chance to find file leaks if opening an input throws exception
@@ -44,7 +42,7 @@ namespace Lucene.Net.Store
                 catch (Exception)
                 {
                 }
-                throw new ThreadInterruptedException(ie);
+                throw new ThreadInterruptedException("Thread Interrupted Exception", ie);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.TestFramework/Util/ThrottledIndexOutput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/ThrottledIndexOutput.cs b/src/Lucene.Net.TestFramework/Util/ThrottledIndexOutput.cs
index 568d99a..18c9534 100644
--- a/src/Lucene.Net.TestFramework/Util/ThrottledIndexOutput.cs
+++ b/src/Lucene.Net.TestFramework/Util/ThrottledIndexOutput.cs
@@ -150,7 +150,7 @@ namespace Lucene.Net.Util
             }
             catch (ThreadInterruptedException e)
             {
-                throw new ThreadInterruptedException(e);
+                throw new ThreadInterruptedException("Thread Interrupted Exception", e);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs b/src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs
index 72de557..c444992 100644
--- a/src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs
+++ b/src/Lucene.Net.Tests.Facet/SlowRAMDirectory.cs
@@ -27,7 +27,6 @@ namespace Lucene.Net.Facet
     using IndexInput = Lucene.Net.Store.IndexInput;
     using IndexOutput = Lucene.Net.Store.IndexOutput;
     using RAMDirectory = Lucene.Net.Store.RAMDirectory;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
 
     /// <summary>
     /// Test utility - slow directory
@@ -87,7 +86,7 @@ namespace Lucene.Net.Facet
             }
             catch (ThreadInterruptedException e)
             {
-                throw new ThreadInterruptedException(e);
+                throw new ThreadInterruptedException("Thread Interrupted Exception", e);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterDeleteQueue.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterDeleteQueue.cs b/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterDeleteQueue.cs
index 205e0ff..3b017ce 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterDeleteQueue.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterDeleteQueue.cs
@@ -1,3 +1,4 @@
+using System.Threading;
 using Apache.NMS.Util;
 using Lucene.Net.Search;
 using System;
@@ -30,7 +31,6 @@ namespace Lucene.Net.Index
     using DeleteSlice = Lucene.Net.Index.DocumentsWriterDeleteQueue.DeleteSlice;
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
     using TermQuery = Lucene.Net.Search.TermQuery;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
 
     /// <summary>
     /// Unit test for <seealso cref="DocumentsWriterDeleteQueue"/>
@@ -282,7 +282,7 @@ namespace Lucene.Net.Index
                 }
                 catch (ThreadInterruptedException e)
                 {
-                    throw new ThreadInterruptedException(e);
+                    throw new ThreadInterruptedException("Thread Interrupted Exception",
e);
                 }
                 int i = 0;
                 while ((i = Index.GetAndIncrement()) < Ids.Length)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterStallControl.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterStallControl.cs b/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterStallControl.cs
index 2fc66be..14d4458 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterStallControl.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDocumentsWriterStallControl.cs
@@ -27,7 +27,6 @@ namespace Lucene.Net.Index
              */
 
     using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
 
     /// <summary>
     /// Tests for <seealso cref="DocumentsWriterStallControl"/>
@@ -275,7 +274,7 @@ namespace Lucene.Net.Index
                             catch (ThreadInterruptedException e)
                             {
                                 Console.WriteLine("[Waiter] got interrupted - wait count:
" + Sync.Waiter.Remaining);
-                                throw new ThreadInterruptedException(e);
+                                throw new ThreadInterruptedException("Thread Interrupted
Exception", e);
                             }
                         }
                     }
@@ -330,7 +329,7 @@ namespace Lucene.Net.Index
                             catch (ThreadInterruptedException e)
                             {
                                 Console.WriteLine("[Updater] got interrupted - wait count:
" + Sync.Waiter.Remaining);
-                                throw new ThreadInterruptedException(e);
+                                throw new ThreadInterruptedException("Thread Interrupted
Exception", e);
                             }
                             Sync.LeftCheckpoint.countDown();
                         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Tests/core/Index/TestIndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriter.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriter.cs
index 941ca10..fe1387b 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriter.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriter.cs
@@ -75,7 +75,6 @@ namespace Lucene.Net.Index
     using TermQuery = Lucene.Net.Search.TermQuery;
     using TestUtil = Lucene.Net.Util.TestUtil;
     using TextField = TextField;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
 
     [TestFixture]
     public class TestIndexWriter : LuceneTestCase

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
index 3b001e2..7cfeda1 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Threading;
 using Lucene.Net.Documents;
 
 namespace Lucene.Net.Index
@@ -43,7 +44,6 @@ namespace Lucene.Net.Index
     using TermQuery = Lucene.Net.Search.TermQuery;
     using TestUtil = Lucene.Net.Util.TestUtil;
     using TextField = TextField;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
     using TopDocs = Lucene.Net.Search.TopDocs;
     
     [TestFixture]
@@ -514,7 +514,7 @@ namespace Lucene.Net.Index
                     }
                     catch (ThreadInterruptedException ie)
                     {
-                        throw new ThreadInterruptedException(ie);
+                        throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs
index 6e118c6..488c713 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs
@@ -46,7 +46,6 @@ namespace Lucene.Net.Index
     using NumericDocValuesField = NumericDocValuesField;
     using TestUtil = Lucene.Net.Util.TestUtil;
     using TextField = TextField;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
 
     /// <summary>
     /// MultiThreaded IndexWriter tests
@@ -113,7 +112,7 @@ namespace Lucene.Net.Index
                             }
                             catch (ThreadInterruptedException ie)
                             {
-                                throw new ThreadInterruptedException(ie);
+                                throw new ThreadInterruptedException("Thread Interrupted
Exception", ie);
                             }
                             if (fullCount++ >= 5)
                             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs b/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
index 3a16e81..d84f55d 100644
--- a/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
@@ -32,7 +32,6 @@ namespace Lucene.Net.Index
 
     using MockAnalyzer = Lucene.Net.Analysis.MockAnalyzer;
     using TextField = TextField;
-    using ThreadInterruptedException = Lucene.Net.Util.ThreadInterruptedException;
 
     //
     // this was developed for Lucene In Action,
@@ -225,7 +224,7 @@ namespace Lucene.Net.Index
                     }
                     catch (ThreadInterruptedException ie)
                     {
-                        throw new ThreadInterruptedException(ie);
+                        throw new ThreadInterruptedException("Thread Interrupted Exception",
ie);
                     }
                 } while (DateTime.Now.Millisecond < StopTime);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9769e6d5/src/Lucene.Net.Tests/core/Util/TestSetOnce.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Util/TestSetOnce.cs b/src/Lucene.Net.Tests/core/Util/TestSetOnce.cs
index 2a97413..af0cd37 100644
--- a/src/Lucene.Net.Tests/core/Util/TestSetOnce.cs
+++ b/src/Lucene.Net.Tests/core/Util/TestSetOnce.cs
@@ -1,3 +1,4 @@
+using System.Threading;
 using Lucene.Net.Support;
 using NUnit.Framework;
 using System;


Mime
View raw message