using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace StressClient { public class ConnectionManager { // 线程列表 List _thread_list; public ConnectionManager() { _thread_list = new List(); } public void Add(Thread thread) { _thread_list.Add(thread); } public void Stop() { try { // 结束各线程 foreach (Thread oneThread in _thread_list) { oneThread.Abort(); } } catch (Exception) { // ignored } } } }