Skip to content

Commit

Permalink
src: fixup node_platform blocking task drain
Browse files Browse the repository at this point in the history
nodejs#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#15639
Refs: nodejs#15428
Refs: f27b5e4
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
addaleax authored and BridgeAR committed Oct 1, 2017
1 parent 0880293 commit dcd890a
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 dcd890a

Please sign in to comment.