mirror of https://github.com/nodejs/node.git
Fix thread pool unref issue.
Tests were silently failing since f56309d... Since the eio_watcher is now not counted in the list of active watchers, we need to explicitly tell the ev_loop not to exit when entering the thread pool.pull/22966/head
parent
b9f3ae23cf
commit
0e67b34c27
|
@ -34,7 +34,8 @@ using namespace node;
|
||||||
Local<Function> l = Local<Function>::Cast(last_arg); \
|
Local<Function> l = Local<Function>::Cast(last_arg); \
|
||||||
callback = new Persistent<Function>(); \
|
callback = new Persistent<Function>(); \
|
||||||
*callback = Persistent<Function>::New(l); \
|
*callback = Persistent<Function>::New(l); \
|
||||||
}
|
} \
|
||||||
|
ev_ref(EV_DEFAULT_UC);
|
||||||
|
|
||||||
#define CALL_CALLBACK_PTR(req, argc, argv) \
|
#define CALL_CALLBACK_PTR(req, argc, argv) \
|
||||||
do { \
|
do { \
|
||||||
|
@ -47,6 +48,7 @@ do { \
|
||||||
node::FatalException(try_catch); \
|
node::FatalException(try_catch); \
|
||||||
delete callback; \
|
delete callback; \
|
||||||
} \
|
} \
|
||||||
|
ev_unref(EV_DEFAULT_UC); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define DEFINE_SIMPLE_CB(name) \
|
#define DEFINE_SIMPLE_CB(name) \
|
||||||
|
|
|
@ -212,6 +212,8 @@ Connection::Connect (const Arguments& args)
|
||||||
|
|
||||||
connection->opening = true;
|
connection->opening = true;
|
||||||
|
|
||||||
|
ev_ref(EV_DEFAULT_UC);
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
/* HACK: Bypass the thread pool and do it sync on Macintosh.
|
/* HACK: Bypass the thread pool and do it sync on Macintosh.
|
||||||
* Experiecing strange error where execution halts on
|
* Experiecing strange error where execution halts on
|
||||||
|
@ -273,6 +275,8 @@ AddressDefaultToIPv4 (struct addrinfo *address_list)
|
||||||
int
|
int
|
||||||
Connection::AfterResolve (eio_req *req)
|
Connection::AfterResolve (eio_req *req)
|
||||||
{
|
{
|
||||||
|
ev_unref(EV_DEFAULT_UC);
|
||||||
|
|
||||||
Connection *connection = static_cast<Connection*> (req->data);
|
Connection *connection = static_cast<Connection*> (req->data);
|
||||||
struct addrinfo *address = NULL,
|
struct addrinfo *address = NULL,
|
||||||
*address_list = static_cast<struct addrinfo *>(req->ptr2);
|
*address_list = static_cast<struct addrinfo *>(req->ptr2);
|
||||||
|
|
Loading…
Reference in New Issue