Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

timer spinner race condition #4866

Closed
trevnorris opened this Issue · 2 comments

2 participants

@trevnorris
Owner

There is an issue where timers < 6ms will run before callbacks passed to nextTick when the callback is fired through _tickFromSpinner:

setTimeout(function() {
    process.nextTick(function() {
        console.error('nextTick');
    })
    setTimeout(function() {
        console.error('setTimeout');
    }, 1);
    // N setTimeout's can be created w/ timeout < 6ms
    // which will all fire before the nextTick callback
}, 1);

// output:
// setTimeout
// nextTick

This issue goes back to the v0.8 branch.

@AlexeyKupershtokh

// N setTimeout's can be created w/ timeout < 6ms

Do you mean that if you write setTimeout(function() {...}, 5) the result would be the same?
There's a known bug #4194 that allows timers false starts but this would work for 1ms timeouts only.

@trevnorris
Owner

Hm. I can't seem to reproduce it and didn't keep anything on it. Well, whatever.

@trevnorris trevnorris closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.