We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6126880 commit 1f76445Copy full SHA for 1f76445
compiler/prelude/goroutines.go
@@ -167,14 +167,14 @@ var $schedule = function(goroutine, direct) {
167
if (!$schedulerLoopActive) {
168
$schedulerLoopActive = true;
169
setTimeout(function() {
170
- while (true) {
171
- var r = $scheduled.shift();
172
- if (r === undefined) {
173
- $schedulerLoopActive = false;
174
- break;
+ try {
+ var r;
+ while ((r = $scheduled.shift()) !== undefined) {
+ r();
175
}
176
- r();
177
- };
+ } finally {
+ $schedulerLoopActive = false;
+ }
178
}, 0);
179
180
};
0 commit comments