/// <summary> /// Remove threads when they have finished /// </summary> /// <param name="sender">The event sender</param> /// <param name="e">EventArgs with information about the thread</param> private void thread_OnThreadFinished(object sender, ThreadFinishedEventArgs e) { try { lock (LockObject) { _threads.Remove(e.SynchronizedThread); } } catch (ArgumentOutOfRangeException) { } }
/// <summary> /// Remove threads when they have finished /// </summary> /// <param name="sender">The event sender</param> /// <param name="e">EventArgs with information about the thread</param> private void thread_OnThreadFinished(object sender, ThreadFinishedEventArgs e) { try { lock (LockObject) { _threads.Remove(e.SynchronizedThread); CleanUpAfterThreadClosed.Invoke(this, e); } } catch (ArgumentOutOfRangeException) { } }