Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timers: remove domain enter and exit #17880

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions lib/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,7 @@ function listOnTimeout() {
continue;
}

var domain = timer.domain;
if (domain) {
domain.enter();
}

tryOnTimeout(timer, list);

if (domain)
domain.exit();
}

// If `L.peek(list)` returned nothing, the list was either empty or we have
Expand Down Expand Up @@ -641,31 +633,22 @@ var immediateQueue = new ImmediateList();
function processImmediate() {
var immediate = immediateQueue.head;
var tail = immediateQueue.tail;
var domain;

// Clear the linked list early in case new `setImmediate()` calls occur while
// immediate callbacks are executed
immediateQueue.head = immediateQueue.tail = null;

while (immediate !== null) {
domain = immediate.domain;

if (!immediate._onImmediate) {
immediate = immediate._idleNext;
continue;
}

if (domain)
domain.enter();

// Save next in case `clearImmediate(immediate)` is called from callback
var next = immediate._idleNext;

tryOnImmediate(immediate, tail);

if (domain)
domain.exit();

// If `clearImmediate(immediate)` wasn't called from the callback, use the
// `immediate`'s next item
if (immediate._idleNext !== null)
Expand Down