<PackageReference Include="NUnit" Version="3.0.0-beta-2" />

ThreadUtility

public static class ThreadUtility
ThreadUtility provides a set of static methods convenient for working with threads.
using System.Threading; namespace NUnit.Framework.Internal { public static class ThreadUtility { public static void Kill(Thread thread) { Kill(thread, null); } public static void Kill(Thread thread, object stateInfo) { try { if (stateInfo == null) thread.Abort(); else thread.Abort(stateInfo); } catch (ThreadStateException) { thread.Resume(); } if ((thread.ThreadState & ThreadState.WaitSleepJoin) != 0) thread.Interrupt(); } } }