You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by di...@apache.org on 2009/12/03 21:17:22 UTC

svn commit: r886902 - /incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs

Author: digy
Date: Thu Dec  3 20:17:21 2009
New Revision: 886902

URL: http://svn.apache.org/viewvc?rev=886902&view=rev
Log:
LUCENENET-308 TestIndexWriter.TestThreadInterruptDeadlock

Modified:
    incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs

Modified: incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Index/TestIndexWriter.cs?rev=886902&r1=886901&r2=886902&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Index/TestIndexWriter.cs Thu Dec  3 20:17:21 2009
@@ -5479,21 +5479,31 @@
 					catch (System.SystemException re)
 					{
 						System.Exception e = re.InnerException;
-						if (e is System.Threading.ThreadInterruptedException)
+                        if (re is System.Threading.ThreadInterruptedException || e is System.Threading.ThreadInterruptedException)
 						{
-							// Make sure IW restored interrupted bit
-							if (Instance.ThreadState != System.Threading.ThreadState.Running)  // {{Aroush-2.9}} in Java, this is: java.lang.Thread.interrupted()
-							{
-								System.Console.Out.WriteLine("FAILED; InterruptedException hit but thread.interrupted() was false");
-								System.Console.Out.WriteLine(e.StackTrace);
-								failed = true;
-								break;
-							}
+                            // {{Aroush-2.9}} in Java, this is: java.lang.Thread.interrupted()
+                            //{There is no way in .Net to check interrupted state. So comment it out
+
+                            //// Make sure IW restored interrupted bit
+                            //if ((Instance.ThreadState & (System.Threading.ThreadState.Stopped | System.Threading.ThreadState.Unstarted)) != System.Threading.ThreadState.Running)  // {{Aroush-2.9}} in Java, this is: java.lang.Thread.interrupted()
+                            //{
+                            //    System.Console.Out.WriteLine("FAILED; InterruptedException hit but thread.interrupted() was false");
+                            //    System.Console.Out.WriteLine(e.StackTrace);
+                            //    failed = true;
+                            //    break;
+                            //}
 						}
 						else
 						{
 							System.Console.Out.WriteLine("FAILED; unexpected exception");
-							System.Console.Out.WriteLine(e.StackTrace);
+                            if (e != null)
+                            {
+                                System.Console.Out.WriteLine(e.StackTrace);
+                            }
+                            else
+                            {
+                                System.Console.Out.WriteLine(re.StackTrace);
+                            }
 							failed = true;
 							break;
 						}