Permalink
Browse files

CPU: Actually keep track of the "_run" timer.

  • Loading branch information...
nelhage committed Jun 2, 2011
1 parent 643f62e commit e778427d1a7c2615c8265f1b2b7159c947e2e166
Showing with 1 addition and 3 deletions.
  1. +1 −3 CPU.js
View
4 CPU.js
@@ -274,8 +274,6 @@ var CPU = {
},
_run: function() {
- if (!CPU.run_timer)
- return;
var i = 0;
while (i++ < 1000 && !CPU.halt)
CPU.step();
@@ -285,7 +283,7 @@ var CPU = {
if (CPU.config.halt)
CPU.config.halt();
} else {
- setTimeout(CPU._run, 0);
+ CPU.run_timer = setTimeout(CPU._run, 0);
}
},

0 comments on commit e778427

Please sign in to comment.