public Abort ( int millisecondsTimeout = 1000 ) : void | ||
millisecondsTimeout | int | |
return | void |
public void Abort(int millisecondsTimeout = 1000)
{
try
{
_cts.Cancel();
if (_thread.Join(millisecondsTimeout) == false)
_thread.Abort();
lock (Threads)
Threads.Remove(Name);
_cts.Dispose();
_cts = null;
_thread = null;
}
catch (Exception)
{
}
}
NamedThread::Abort ( string name, int millisecondsTimeout = 1000 ) : void |
public static void Abort(string name, int millisecondsTimeout = 1000) { lock (Threads) { NamedThread namedThread = Threads[name]; if (namedThread == null) { return; } namedThread.Abort(millisecondsTimeout); } }