Skip to content

Commit

Permalink
worker: spin uv_run twice before closing loop
Browse files Browse the repository at this point in the history
On Windows, the Platform’s `uv_async_t` may need two iterations
before closing when it was previously in use.

Refs: #26089
Refs: #26006

PR-URL: #26138
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
  • Loading branch information
addaleax authored and rvagg committed Feb 28, 2019
1 parent d550de4 commit dab64bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/node_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ class WorkerThreadData {

isolate->Dispose();

// Need to run the loop one more time to close the platform's uv_async_t
// Need to run the loop twice more to close the platform's uv_async_t
// TODO(addaleax): It would be better for the platform itself to provide
// some kind of notification when it has fully cleaned up.
uv_run(&loop_, UV_RUN_ONCE);
uv_run(&loop_, UV_RUN_ONCE);

CheckedUvLoopClose(&loop_);
Expand Down

0 comments on commit dab64bb

Please sign in to comment.