diff --git a/src/win/internal.h b/src/win/internal.h index 37836426..a10bba25 100644 --- a/src/win/internal.h +++ b/src/win/internal.h @@ -110,6 +110,7 @@ void uv_process_endgames(); #define DECREASE_PENDING_REQ_COUNT(handle) \ do { \ + assert(handle->reqs_pending > 0); \ handle->reqs_pending--; \ \ if (handle->flags & UV_HANDLE_CLOSING && \ diff --git a/src/win/pipe.c b/src/win/pipe.c index 9b8bdbdd..1f8e2da2 100644 --- a/src/win/pipe.c +++ b/src/win/pipe.c @@ -317,6 +317,8 @@ static DWORD WINAPI pipe_connect_thread_proc(void* parameter) { uv_fatal_error(GetLastError(), "PostQueuedCompletionStatus"); } + handle->reqs_pending++; + return 0; }