diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-15 21:53:54 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-18 02:06:49 +0300 |
commit | 1d513536651c69076ab8e7d4b2cabe009b1e6f8f (patch) | |
tree | 8b96722b6f07e3457685f1617c8152c20565c3db /src | |
parent | c58324534c7b1e7868e4d05b546560fb8263a286 (diff) |
worker: spin uv_run twice before closing loop
On Windows, the Platform’s `uv_async_t` may need two iterations
before closing when it was previously in use.
Refs: https://github.com/nodejs/node/pull/26089
Refs: https://github.com/nodejs/node/pull/26006
PR-URL: https://github.com/nodejs/node/pull/26138
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_worker.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/node_worker.cc b/src/node_worker.cc index 53789de1e89..2c8222f7f52 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -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_); |