Skip to content

Commit dab64bb

Browse files
addaleaxrvagg
authored andcommitted
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: #26089 Refs: #26006 PR-URL: #26138 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent d550de4 commit dab64bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node_worker.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ class WorkerThreadData {
150150

151151
isolate->Dispose();
152152

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

156159
CheckedUvLoopClose(&loop_);

0 commit comments

Comments
 (0)