Skip to content

Commit

Permalink
J2N.Threading.ThreadJob: Allow ThreadInterruptedException to propagat…
Browse files Browse the repository at this point in the history
…e to the calling thread
  • Loading branch information
NightOwl888 committed Apr 19, 2021
1 parent 5a5b956 commit fb45e82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/J2N/Threading/ThreadJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ protected virtual void SafeRun(ThreadStart start)

private bool IsThreadingException(Exception e)
{
// NOTE: We don't swallow ThreadAbortException because we don't want
// to interfere with normal operation of the thread.
// We also had ThreadInterruptedExcption here once, but Lucene.NET requires
// it to be rethrown on the calling thread.
return
#if FEATURE_THREADINTERRUPT
e.GetType().Equals(typeof(ThreadInterruptedException)) ||
#endif
#if FEATURE_THREADABORT
e.GetType().Equals(typeof(ThreadAbortException)) ||
#endif
Expand Down Expand Up @@ -456,7 +457,6 @@ public static void Sleep(long milliSeconds, int nanoSeconds)
/// has a bending interrupt request; othewise, <c>false</c>.</returns>
public static bool Interrupted()
{

try
{
Thread.Sleep(0);
Expand Down

0 comments on commit fb45e82

Please sign in to comment.