fix: libuv hang on Windows (#28175)

This commit is contained in:
Shelley Vohr 2021-03-22 20:11:03 +00:00 committed by GitHub
parent d10398610b
commit 665ac6f9c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 86 additions and 6 deletions

View file

@ -534,15 +534,13 @@ void NodeBindings::LoadEnvironment(node::Environment* env) {
void NodeBindings::PrepareMessageLoop() {
#if !defined(OS_WIN)
int handle = uv_backend_fd(uv_loop_);
#else
HANDLE handle = uv_loop_->iocp;
#endif
// 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.

View file

@ -159,9 +159,7 @@ class NodeBindings {
// Isolate data used in creating the environment
node::IsolateData* isolate_data_ = nullptr;
#if defined(OS_WIN)
HANDLE handle_;
#else
#if !defined(OS_WIN)
int handle_ = -1;
#endif