public static ServiceThread CreateThread(ThreadParam tp, CreateThreadDelegete callBack) { ServiceThread serviceThread = new ServiceThread(tp); serviceThread.currentThread = new Thread(new ThreadStart(serviceThread.Execute)); serviceThread.currentThread.Name = tp.Name; serviceThread.callBack = callBack; return(serviceThread); }
private void AddThread(ThreadParam tp) { try { tp.ExitEvent = this.exitEvent; tp.EntryType = ServiceArguments.Current.EntryType; if (tp.ThreadTask != null) { tp.ThreadTask.Params = tp; this.threads.Add(ServiceThread.CreateThread(tp, CreateThreadEvent)); } } catch (Exception ex) { this.Log.Write(string.Format("载入线程\"{0}\"出错", tp.Name), ex, ServiceLogEventID.SERVICEMAIN_ADDTHREAD); throw; } }
public void Add(ServiceThread thread) { InnerList.Add(thread); }
public static ServiceThread CreateThread(ThreadParam tp, CreateThreadDelegete callBack) { ServiceThread serviceThread = new ServiceThread(tp); serviceThread.currentThread = new Thread(new ThreadStart(serviceThread.Execute)); serviceThread.currentThread.Name = tp.Name; serviceThread.callBack = callBack; return serviceThread; }