0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

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>
This commit is contained in:
Anna Henningsen 2019-02-15 19:53:54 +01:00
parent c58324534c
commit 1d51353665
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -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_);