public async void AbortAsync(int millisecondsTimeout = 1000)
{
await Task.Run(() =>
{
try
{
_cts.Cancel();
if (_thread.Join(millisecondsTimeout) == false)
_thread.Abort();
lock (Threads)
Threads.Remove(Name);
_cts.Dispose();
_cts = null;
_thread = null;
}
catch (Exception)
{
}
});
}