fix: iocp integration when process is reused (#33207)

This commit is contained in:
Robo
2022-03-21 16:42:22 +09:00
committed by GitHub
parent e100402b13
commit 4cc2ed842e
9 changed files with 83 additions and 17 deletions

View File

@@ -462,7 +462,8 @@ node::Environment* NodeBindings::CreateEnvironment(
args.insert(args.begin() + 1, init_script);
isolate_data_ = node::CreateIsolateData(isolate, uv_loop_, platform);
if (!isolate_data_)
isolate_data_ = node::CreateIsolateData(isolate, uv_loop_, platform);
node::Environment* env;
uint64_t flags = node::EnvironmentFlags::kDefaultFlags |
@@ -573,16 +574,6 @@ void NodeBindings::LoadEnvironment(node::Environment* env) {
}
void NodeBindings::PrepareMessageLoop() {
#if !BUILDFLAG(IS_WIN)
int handle = uv_backend_fd(uv_loop_);
// If the backend fd hasn't changed, don't proceed.
if (handle == handle_)
return;
handle_ = handle;
#endif
// Add dummy handle for libuv, otherwise libuv would quit when there is
// nothing to do.
uv_async_init(uv_loop_, dummy_uv_handle_.get(), nullptr);