fix: libuv hang on Windows (#28337)

* fix: libuv hang on Windows

* test: add a hang test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2021-03-23 03:00:36 -07:00
committed by GitHub
parent d2a342c74d
commit d121bcbbb5
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