Skip to content

Commit

Permalink
src: fixup node_platform blocking task drain
Browse files Browse the repository at this point in the history
#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: #15639
Refs: #15428
Refs: f27b5e4
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 authored and targos committed Oct 18, 2017
1 parent 33d5262 commit 419876a
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 419876a

Please sign in to comment.