/// <summary> /// Request the state machine to run, if required. /// </summary> private void RequestRun() { if (WantToRunNow() && m_wakeUpMsg == null) { m_wakeUpMsg = new KmodBrokerWakeUpMsg(this); KBase.ExecInUI(new KBase.EmptyDelegate(m_wakeUpMsg.Run)); } }
/// <summary> /// Run the broker state machine. Only call RequestRun() to execute /// this method. /// </summary> public void Run() { Debug.Assert(m_wakeUpMsg != null); try { // Loop until our state stabilize. while (WantToRunNow()) { Debug.Assert(m_curTransaction == null); Debug.Assert(m_curCommand == null); // We're disabled. Kill all transactions. if (!m_enabledFlag) { Killall(new Exception("KMOD broker disabled")); } // Execute the next transaction. else { m_curTransaction = m_transactionQueue[0]; m_transactionQueue.RemoveAt(0); Debug.Assert(m_curTransaction.Status == KmodTransactionStatus.Queued); m_curTransaction.Status = KmodTransactionStatus.Executing; // We have to start KMOD. if (m_curThread == null) { StartKmodThread(); } // Execute the current transaction. else { StartCurrentTransaction(); } } } } // We cannot recover from these errors. catch (Exception ex) { KBase.HandleException(ex, true); } m_wakeUpMsg = null; }
/// <summary> /// Run the broker state machine. Only call RequestRun() to execute /// this method. /// </summary> public void Run() { Debug.Assert(m_wakeUpMsg != null); try { // Loop until our state stabilize. while (WantToRunNow()) { Debug.Assert(m_curTransaction == null); Debug.Assert(m_curCommand == null); // We're disabled. Kill all transactions. if (!m_enabledFlag) Killall(new Exception("KMOD broker disabled")); // Execute the next transaction. else { m_curTransaction = m_transactionQueue[0]; m_transactionQueue.RemoveAt(0); Debug.Assert(m_curTransaction.Status == KmodTransactionStatus.Queued); m_curTransaction.Status = KmodTransactionStatus.Executing; // We have to start KMOD. if (m_curThread == null) StartKmodThread(); // Execute the current transaction. else StartCurrentTransaction(); } } } // We cannot recover from these errors. catch (Exception ex) { KBase.HandleException(ex, true); } m_wakeUpMsg = null; }
/// <summary> /// Request the state machine to run, if required. /// </summary> private void RequestRun() { if (WantToRunNow() && m_wakeUpMsg == null) { m_wakeUpMsg = new KmodBrokerWakeUpMsg(this); Misc.MainForm.BeginInvoke(new Base.EmptyDelegate(m_wakeUpMsg.Run)); } }