private void Run(ICpu cpu) { //we intentionally use unsynchronized access for performance (this does no cause a race condition) while (GetSouldScheduleNewCycles()) { NotifyClockCycleScheduled(cpu); try { cpu.ClockCycle(); ExecutedClockCycles++; DecrementCycleCounter(); } catch (CpuException e) { SetCycleCounter(0); NotifyExecutionCompleted(e); break; } } }