public void Start() { Assert(State == JobState_t.Pending); Thread thread = new Thread(ThreadProc); thread.Priority = ThreadPriority.BelowNormal; thread.IsBackground = true; State = JobState_t.Running; thread.Start(); }
//private: void ThreadProc() { try { DoWork(); State = JobState_t.Finished; Succeeded?.Invoke(this); } catch (Exception ex) { State = JobState_t.Finished; Aborted?.Invoke(this, ex); } Aborted = null; Succeeded = null; }
protected virtual void DoStart() { State = JobState_t.Running; new Thread(ThreadProc).Start(); }