public void Pause() { if (!Running) return; m_Pausing = true; while (m_Pausing) { // wait until the cpu has stopped running, then return. // we wait 1ms between each try so we don't lock this variable. Thread.Sleep(1); } }