As the documentation states, a ThreadAbortException should automatically be re-thrown at the end of a catch block: https://msdn.microsoft.com/en-us/library/system.threading.threadabortexception(v=vs.110)
> ThreadAbortException is a special exception that can be caught, but it will automatically be raised again at the end of the catch block
Take the following program:
static void Main(string args)
var mutex = new ManualResetEventSlim();
var t = new Thread(() =>
// Do some stuff
catch (Exception ex)
Console.WriteLine("Exception: " + ex.Message);
// Wait for the thread to start
When compiled in x64 and run with RyuJIT, the ThreadAbortException isn't re-thrown at the end of the catch block, thus resulting in an infinite loop.
It seems to be related to RyuJIT, because the bug disappears when using the legacy JIT:
<useLegacyJit enabled="1" />
Reproduced with Visual Studio 2017, .NET 4.6.2, compiled in Release and x64.