/// <summary> /// /// </summary> private void IniMyClass() { Console.WriteLine("ini calculator thread"); for (int i = 0; i < this.defaultCalculatorNumber; i++) { Calculator cal = new Calculator(this); this.Calculators.Add(cal); } if (this.controlThread == null) { this.controlThread = new Thread(new ThreadStart(this.ControlTask)); this.controlThread.Start(); } this.isSettingCalculatorTask = false; Console.WriteLine("ini control thread"); }
/// <summary> /// all calculator call this function when it finish its job. /// </summary> /// <param name="CalculatorObj">calculator object done job</param> public void CalculatorFreeNotify(Calculator CalculatorObj) { if (this.isPauseControlTask) { //wake up control task // this.isPauseControlTask = false; } }