void WorkerReboot_DoWork(object sender, DoWorkEventArgs e) { Thread.Sleep(1000); CopyDataToReal(); ThreadMain.Run(); XtraMessageBox.Show("Выполнена перезагрузка потока.", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); }
/// <summary> /// Start按钮按下后,开启程序任务 /// </summary> private void StartMailServerTask() { if (tdMain == null && !ThreadMain.isStart && !ThreadMain.stop) { tdMain = new ThreadMain(); tdMain.StartMainThread(); this.TxtServerStatus.Text = "Run"; } }
/// <summary> /// Stop按钮按下后,结束程序任务 /// </summary> private void StopMailServerTask() { if (tdMain != null) { tdMain.StopMainThread(); this.TxtServerStatus.Text = "Stop"; tdMain = null; } }
/// <summary> /// Закрытие подключений. /// </summary> public void OPCDisconnect() { if (ThreadMain != null) { ThreadMain.Stop(); } if (OPCServerRealCollection != null) { foreach (OPCServerReal opcServer in OPCServerRealCollection) { opcServer.TryDisconnect(); } } }
private void StartSystemThreads() { ThreadRHI.FromCurrent("RHI"); ThreadMain.FromCurrent("Main"); ThreadEditor.FromCurrent("Editor"); ThreadLogic.StartThread("Logic", null); ThreadRender.StartThread("Render", null); ThreadAsync.StartThread("AsyncIO", null); ThreadPhysics.StartThread("Physics", null); if (CIPlatform.Instance.PlayMode != CIPlatform.enPlayMode.Game) { ThreadAsyncEditor.StartThread("AsyncEditor", null); ThreadAsyncEditorSlow.StartThread("AsyncEditorSlow", null); } EventPoster.StartPools(Desc.ThreadPoolCount); }
public new bool CheckComplete(int time = 500) { return(ThreadMain.Join(time)); }
public new void Start() { this.ThreadMain = new Thread(Sort); ThreadMain.Name = "BubbleSort"; ThreadMain.Start(); }