Skip to content

Commit

Permalink
src: fixup node_platform blocking task drain
Browse files Browse the repository at this point in the history
nodejs/node#15428 was supposed to account
for upcoming changes in V8 upstream, but while addressing review
comments a bug was introduced; `DrainBackgroundTasks()` should
always at least perform one blocking drain on the background task
queue.

PR-URL: nodejs/node#15639
Refs: nodejs/node#15428
Refs: f27b5e4bdaafc73a830a0451ee3c641b8bcd08fe
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
addaleax committed Oct 4, 2017
1 parent 93cd76f commit e02fc82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/node_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ static void RunForegroundTask(uv_timer_t* handle) {
}

void NodePlatform::DrainBackgroundTasks() {
while (FlushForegroundTasksInternal())
do {
background_tasks_.BlockingDrain();
} while (FlushForegroundTasksInternal());
}

bool NodePlatform::FlushForegroundTasksInternal() {
Expand Down

0 comments on commit e02fc82

Please sign in to comment.