コード例 #1
0
        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);
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
 public void Add(ServiceThread thread)
 {
     InnerList.Add(thread);
 }
コード例 #4
0
        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;
        }
コード例 #5
0
 public void Add(ServiceThread thread)
 {
     InnerList.Add(thread);
 }