Aegis.Threading.NamedThread.AbortAsync C# (CSharp) Method

AbortAsync() public method

public AbortAsync ( int millisecondsTimeout = 1000 ) : void
millisecondsTimeout int
return void
        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)
                {
                }
            });
        }