public void WaitForFinishing() { bool alive = true; while (alive && this.Threads.Count > 0) { alive = false; ThreadCollection removeList = new ThreadCollection(); foreach (Thread thread in this.Threads) { if (thread.IsAlive) { alive = true; } else { removeList.Add(thread); } } foreach (Thread thread in removeList) { this.Threads.Remove(thread); } // Fix for http://www.mertner.com/jira/browse/MBUNIT-134 by Richard Louapre Thread.Sleep(10); } }
public void Dispose() { if (this.threads != null) { this.AbortAll(); this.Threads.Clear(); this.threads = null; } }
public Enumerator(ThreadCollection collection) { this.wrapped = ((System.Collections.CollectionBase)collection).GetEnumerator(); }
public void WaitForFinishing() { bool alive = true; while (alive && this.Threads.Count>0) { alive=false; ThreadCollection removeList = new ThreadCollection(); foreach(Thread thread in this.Threads) { if ( thread.IsAlive ) { alive = true; } else { removeList.Add( thread ); } } foreach ( Thread thread in removeList ) { this.Threads.Remove( thread ); } // Fix for http://www.mertner.com/jira/browse/MBUNIT-134 by Richard Louapre Thread.Sleep(10); } }