summaryrefslogtreecommitdiff
path: root/deps/uv/src/win
diff options
context:
space:
mode:
Diffstat (limited to 'deps/uv/src/win')
-rw-r--r--deps/uv/src/win/async.c6
-rw-r--r--deps/uv/src/win/fs-event.c8
-rw-r--r--deps/uv/src/win/handle-inl.h4
-rw-r--r--deps/uv/src/win/handle.c6
-rw-r--r--deps/uv/src/win/internal.h4
-rw-r--r--deps/uv/src/win/loop-watcher.c2
-rw-r--r--deps/uv/src/win/pipe.c8
-rw-r--r--deps/uv/src/win/poll.c10
-rw-r--r--deps/uv/src/win/process.c4
-rw-r--r--deps/uv/src/win/signal.c4
-rw-r--r--deps/uv/src/win/tcp.c6
-rw-r--r--deps/uv/src/win/thread.c7
-rw-r--r--deps/uv/src/win/threadpool.c4
-rw-r--r--deps/uv/src/win/timer.c2
-rw-r--r--deps/uv/src/win/tty.c14
-rw-r--r--deps/uv/src/win/udp.c2
16 files changed, 43 insertions, 48 deletions
diff --git a/deps/uv/src/win/async.c b/deps/uv/src/win/async.c
index 4247c75a5d..edf6529733 100644
--- a/deps/uv/src/win/async.c
+++ b/deps/uv/src/win/async.c
@@ -29,7 +29,7 @@
void uv_async_endgame(uv_loop_t* loop, uv_async_t* handle) {
- if (handle->flags & UV_HANDLE_CLOSING &&
+ if (handle->flags & UV__HANDLE_CLOSING &&
!handle->async_sent) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
uv__handle_close(handle);
@@ -74,7 +74,7 @@ int uv_async_send(uv_async_t* handle) {
/* The user should make sure never to call uv_async_send to a closing */
/* or closed handle. */
- assert(!(handle->flags & UV_HANDLE_CLOSING));
+ assert(!(handle->flags & UV__HANDLE_CLOSING));
if (!uv__atomic_exchange_set(&handle->async_sent)) {
POST_COMPLETION_FOR_REQ(loop, &handle->async_req);
@@ -91,7 +91,7 @@ void uv_process_async_wakeup_req(uv_loop_t* loop, uv_async_t* handle,
handle->async_sent = 0;
- if (!(handle->flags & UV_HANDLE_CLOSING)) {
+ if (!(handle->flags & UV__HANDLE_CLOSING)) {
handle->async_cb((uv_async_t*) handle, 0);
} else {
uv_want_endgame(loop, (uv_handle_t*)handle);
diff --git a/deps/uv/src/win/fs-event.c b/deps/uv/src/win/fs-event.c
index 0874a768a1..c20c07308f 100644
--- a/deps/uv/src/win/fs-event.c
+++ b/deps/uv/src/win/fs-event.c
@@ -301,7 +301,7 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
/* If we're closing, don't report any callbacks, and just push the handle */
/* onto the endgame queue. */
- if (handle->flags & UV_HANDLE_CLOSING) {
+ if (handle->flags & UV__HANDLE_CLOSING) {
uv_want_endgame(loop, (uv_handle_t*) handle);
return;
};
@@ -443,7 +443,7 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
}
offset = file_info->NextEntryOffset;
- } while (offset && !(handle->flags & UV_HANDLE_CLOSING));
+ } while (offset && !(handle->flags & UV__HANDLE_CLOSING));
} else {
handle->cb(handle, NULL, UV_CHANGE, 0);
}
@@ -452,7 +452,7 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
handle->cb(handle, NULL, 0, -1);
}
- if (!(handle->flags & UV_HANDLE_CLOSING)) {
+ if (!(handle->flags & UV__HANDLE_CLOSING)) {
uv_fs_event_queue_readdirchanges(loop, handle);
} else {
uv_want_endgame(loop, (uv_handle_t*)handle);
@@ -475,7 +475,7 @@ void uv_fs_event_close(uv_loop_t* loop, uv_fs_event_t* handle) {
void uv_fs_event_endgame(uv_loop_t* loop, uv_fs_event_t* handle) {
- if (handle->flags & UV_HANDLE_CLOSING &&
+ if (handle->flags & UV__HANDLE_CLOSING &&
!handle->req_pending) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
diff --git a/deps/uv/src/win/handle-inl.h b/deps/uv/src/win/handle-inl.h
index 3b02b7f0a5..159d2208bb 100644
--- a/deps/uv/src/win/handle-inl.h
+++ b/deps/uv/src/win/handle-inl.h
@@ -31,7 +31,7 @@
#define DECREASE_ACTIVE_COUNT(loop, handle) \
do { \
if (--(handle)->activecnt == 0 && \
- !((handle)->flags & UV_HANDLE_CLOSING)) { \
+ !((handle)->flags & UV__HANDLE_CLOSING)) { \
uv__handle_stop((handle)); \
} \
assert((handle)->activecnt >= 0); \
@@ -52,7 +52,7 @@
assert(handle->reqs_pending > 0); \
handle->reqs_pending--; \
\
- if (handle->flags & UV_HANDLE_CLOSING && \
+ if (handle->flags & UV__HANDLE_CLOSING && \
handle->reqs_pending == 0) { \
uv_want_endgame(loop, (uv_handle_t*)handle); \
} \
diff --git a/deps/uv/src/win/handle.c b/deps/uv/src/win/handle.c
index d300bd2b62..64ff1b2133 100644
--- a/deps/uv/src/win/handle.c
+++ b/deps/uv/src/win/handle.c
@@ -59,14 +59,14 @@ uv_handle_type uv_guess_handle(uv_file file) {
int uv_is_active(const uv_handle_t* handle) {
return (handle->flags & UV__HANDLE_ACTIVE) &&
- !(handle->flags & UV_HANDLE_CLOSING);
+ !(handle->flags & UV__HANDLE_CLOSING);
}
void uv_close(uv_handle_t* handle, uv_close_cb cb) {
uv_loop_t* loop = handle->loop;
- if (handle->flags & UV_HANDLE_CLOSING) {
+ if (handle->flags & UV__HANDLE_CLOSING) {
assert(0);
return;
}
@@ -149,5 +149,5 @@ void uv_close(uv_handle_t* handle, uv_close_cb cb) {
int uv_is_closing(const uv_handle_t* handle) {
- return handle->flags & (UV_HANDLE_CLOSING | UV_HANDLE_CLOSED);
+ return handle->flags & (UV__HANDLE_CLOSING | UV_HANDLE_CLOSED);
}
diff --git a/deps/uv/src/win/internal.h b/deps/uv/src/win/internal.h
index fe38890627..f0d0d7a55a 100644
--- a/deps/uv/src/win/internal.h
+++ b/deps/uv/src/win/internal.h
@@ -36,14 +36,14 @@
*/
/* Used by all handles. */
-#define UV_HANDLE_CLOSING 0x00000001
#define UV_HANDLE_CLOSED 0x00000002
#define UV_HANDLE_ENDGAME_QUEUED 0x00000004
#define UV_HANDLE_ACTIVE 0x00000010
+/* uv-common.h: #define UV__HANDLE_CLOSING 0x00000001 */
/* uv-common.h: #define UV__HANDLE_ACTIVE 0x00000040 */
/* uv-common.h: #define UV__HANDLE_REF 0x00000020 */
-/* reserved: #define UV_HANDLE_INTERNAL 0x00000080 */
+/* uv-common.h: #define UV_HANDLE_INTERNAL 0x00000080 */
/* Used by streams and UDP handles. */
#define UV_HANDLE_READING 0x00000100
diff --git a/deps/uv/src/win/loop-watcher.c b/deps/uv/src/win/loop-watcher.c
index ee80feb96f..9fff631c48 100644
--- a/deps/uv/src/win/loop-watcher.c
+++ b/deps/uv/src/win/loop-watcher.c
@@ -27,7 +27,7 @@
void uv_loop_watcher_endgame(uv_loop_t* loop, uv_handle_t* handle) {
- if (handle->flags & UV_HANDLE_CLOSING) {
+ if (handle->flags & UV__HANDLE_CLOSING) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
handle->flags |= UV_HANDLE_CLOSED;
uv__handle_close(handle);
diff --git a/deps/uv/src/win/pipe.c b/deps/uv/src/win/pipe.c
index 819091efe6..59138224c2 100644
--- a/deps/uv/src/win/pipe.c
+++ b/deps/uv/src/win/pipe.c
@@ -292,7 +292,7 @@ void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle) {
/* Clear the shutdown_req field so we don't go here again. */
handle->shutdown_req = NULL;
- if (handle->flags & UV_HANDLE_CLOSING) {
+ if (handle->flags & UV__HANDLE_CLOSING) {
UNREGISTER_HANDLE_REQ(loop, handle, req);
/* Already closing. Cancel the shutdown. */
@@ -354,7 +354,7 @@ void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle) {
}
}
- if (handle->flags & UV_HANDLE_CLOSING &&
+ if (handle->flags & UV__HANDLE_CLOSING &&
handle->reqs_pending == 0) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
@@ -754,7 +754,7 @@ int uv_pipe_accept(uv_pipe_t* server, uv_stream_t* client) {
req->next_pending = NULL;
req->pipeHandle = INVALID_HANDLE_VALUE;
- if (!(server->flags & UV_HANDLE_CLOSING)) {
+ if (!(server->flags & UV__HANDLE_CLOSING)) {
uv_pipe_queue_accept(loop, server, req, FALSE);
}
}
@@ -1493,7 +1493,7 @@ void uv_process_pipe_accept_req(uv_loop_t* loop, uv_pipe_t* handle,
CloseHandle(req->pipeHandle);
req->pipeHandle = INVALID_HANDLE_VALUE;
}
- if (!(handle->flags & UV_HANDLE_CLOSING)) {
+ if (!(handle->flags & UV__HANDLE_CLOSING)) {
uv_pipe_queue_accept(loop, handle, req, FALSE);
}
}
diff --git a/deps/uv/src/win/poll.c b/deps/uv/src/win/poll.c
index c6feaae51c..82197241c1 100644
--- a/deps/uv/src/win/poll.c
+++ b/deps/uv/src/win/poll.c
@@ -198,7 +198,7 @@ static void uv__fast_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
if ((handle->events & ~(handle->submitted_events_1 |
handle->submitted_events_2)) != 0) {
uv__fast_poll_submit_poll_req(loop, handle);
- } else if ((handle->flags & UV_HANDLE_CLOSING) &&
+ } else if ((handle->flags & UV__HANDLE_CLOSING) &&
handle->submitted_events_1 == 0 &&
handle->submitted_events_2 == 0) {
uv_want_endgame(loop, (uv_handle_t*) handle);
@@ -208,7 +208,7 @@ static void uv__fast_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
static int uv__fast_poll_set(uv_loop_t* loop, uv_poll_t* handle, int events) {
assert(handle->type == UV_POLL);
- assert(!(handle->flags & UV_HANDLE_CLOSING));
+ assert(!(handle->flags & UV__HANDLE_CLOSING));
assert((events & ~(UV_READABLE | UV_WRITABLE)) == 0);
handle->events = events;
@@ -445,7 +445,7 @@ static void uv__slow_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
if ((handle->events & ~(handle->submitted_events_1 |
handle->submitted_events_2)) != 0) {
uv__slow_poll_submit_poll_req(loop, handle);
- } else if ((handle->flags & UV_HANDLE_CLOSING) &&
+ } else if ((handle->flags & UV__HANDLE_CLOSING) &&
handle->submitted_events_1 == 0 &&
handle->submitted_events_2 == 0) {
uv_want_endgame(loop, (uv_handle_t*) handle);
@@ -455,7 +455,7 @@ static void uv__slow_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
static int uv__slow_poll_set(uv_loop_t* loop, uv_poll_t* handle, int events) {
assert(handle->type == UV_POLL);
- assert(!(handle->flags & UV_HANDLE_CLOSING));
+ assert(!(handle->flags & UV__HANDLE_CLOSING));
assert((events & ~(UV_READABLE | UV_WRITABLE)) == 0);
handle->events = events;
@@ -605,7 +605,7 @@ void uv_poll_close(uv_loop_t* loop, uv_poll_t* handle) {
void uv_poll_endgame(uv_loop_t* loop, uv_poll_t* handle) {
- assert(handle->flags & UV_HANDLE_CLOSING);
+ assert(handle->flags & UV__HANDLE_CLOSING);
assert(!(handle->flags & UV_HANDLE_CLOSED));
assert(handle->submitted_events_1 == 0);
diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c
index e2b055f5d8..8d22e742d5 100644
--- a/deps/uv/src/win/process.c
+++ b/deps/uv/src/win/process.c
@@ -689,7 +689,7 @@ void uv_process_proc_exit(uv_loop_t* loop, uv_process_t* handle) {
/* If we're closing, don't call the exit callback. Just schedule a close */
/* callback now. */
- if (handle->flags & UV_HANDLE_CLOSING) {
+ if (handle->flags & UV__HANDLE_CLOSING) {
uv_want_endgame(loop, (uv_handle_t*) handle);
return;
}
@@ -743,7 +743,7 @@ void uv_process_close(uv_loop_t* loop, uv_process_t* handle) {
void uv_process_endgame(uv_loop_t* loop, uv_process_t* handle) {
assert(!handle->exit_cb_pending);
- assert(handle->flags & UV_HANDLE_CLOSING);
+ assert(handle->flags & UV__HANDLE_CLOSING);
assert(!(handle->flags & UV_HANDLE_CLOSED));
/* Clean-up the process handle. */
diff --git a/deps/uv/src/win/signal.c b/deps/uv/src/win/signal.c
index 73aeff19b6..e630cd38bc 100644
--- a/deps/uv/src/win/signal.c
+++ b/deps/uv/src/win/signal.c
@@ -323,7 +323,7 @@ void uv_process_signal_req(uv_loop_t* loop, uv_signal_t* handle,
if (dispatched_signum == handle->signum)
handle->signal_cb(handle, dispatched_signum);
- if (handle->flags & UV_HANDLE_CLOSING) {
+ if (handle->flags & UV__HANDLE_CLOSING) {
/* When it is closing, it must be stopped at this point. */
assert(handle->signum == 0);
uv_want_endgame(loop, (uv_handle_t*) handle);
@@ -342,7 +342,7 @@ void uv_signal_close(uv_loop_t* loop, uv_signal_t* handle) {
void uv_signal_endgame(uv_loop_t* loop, uv_signal_t* handle) {
- assert(handle->flags & UV_HANDLE_CLOSING);
+ assert(handle->flags & UV__HANDLE_CLOSING);
assert(!(handle->flags & UV_HANDLE_CLOSED));
assert(handle->signum == 0);
diff --git a/deps/uv/src/win/tcp.c b/deps/uv/src/win/tcp.c
index 0bc01c613d..1be1d186f2 100644
--- a/deps/uv/src/win/tcp.c
+++ b/deps/uv/src/win/tcp.c
@@ -164,7 +164,7 @@ void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle) {
UNREGISTER_HANDLE_REQ(loop, handle, handle->shutdown_req);
- if (handle->flags & UV_HANDLE_CLOSING) {
+ if (handle->flags & UV__HANDLE_CLOSING) {
status = -1;
uv__set_artificial_error(loop, UV_ECANCELED);
} else if (shutdown(handle->socket, SD_SEND) != SOCKET_ERROR) {
@@ -183,7 +183,7 @@ void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle) {
return;
}
- if (handle->flags & UV_HANDLE_CLOSING &&
+ if (handle->flags & UV__HANDLE_CLOSING &&
handle->reqs_pending == 0) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
@@ -612,7 +612,7 @@ int uv_tcp_accept(uv_tcp_t* server, uv_tcp_t* client) {
req->next_pending = NULL;
req->accept_socket = INVALID_SOCKET;
- if (!(server->flags & UV_HANDLE_CLOSING)) {
+ if (!(server->flags & UV__HANDLE_CLOSING)) {
/* Check if we're in a middle of changing the number of pending accepts. */
if (!(server->flags & UV_HANDLE_TCP_ACCEPT_STATE_CHANGING)) {
uv_tcp_queue_accept(server, req);
diff --git a/deps/uv/src/win/thread.c b/deps/uv/src/win/thread.c
index aecfaf4f88..cb2ba4ec61 100644
--- a/deps/uv/src/win/thread.c
+++ b/deps/uv/src/win/thread.c
@@ -60,11 +60,6 @@ static NOINLINE void uv__once_inner(uv_once_t* guard,
void (*callback)(void)) {
DWORD result;
HANDLE existing_event, created_event;
- HANDLE* event_ptr;
-
- /* Fetch and align event_ptr */
- event_ptr = (HANDLE*) (((uintptr_t) &guard->event + (sizeof(HANDLE) - 1)) &
- ~(sizeof(HANDLE) - 1));
created_event = CreateEvent(NULL, 1, 0, NULL);
if (created_event == 0) {
@@ -72,7 +67,7 @@ static NOINLINE void uv__once_inner(uv_once_t* guard,
uv_fatal_error(GetLastError(), "CreateEvent");
}
- existing_event = InterlockedCompareExchangePointer(event_ptr,
+ existing_event = InterlockedCompareExchangePointer(&guard->event,
created_event,
NULL);
diff --git a/deps/uv/src/win/threadpool.c b/deps/uv/src/win/threadpool.c
index 48e00b8795..c1a71c18e0 100644
--- a/deps/uv/src/win/threadpool.c
+++ b/deps/uv/src/win/threadpool.c
@@ -68,7 +68,7 @@ int uv_queue_work(uv_loop_t* loop, uv_work_t* req, uv_work_cb work_cb,
void uv_process_work_req(uv_loop_t* loop, uv_work_t* req) {
- assert(req->after_work_cb);
uv__req_unregister(loop, req);
- req->after_work_cb(req);
+ if(req->after_work_cb)
+ req->after_work_cb(req);
}
diff --git a/deps/uv/src/win/timer.c b/deps/uv/src/win/timer.c
index 239f78843e..370f2b6dc8 100644
--- a/deps/uv/src/win/timer.c
+++ b/deps/uv/src/win/timer.c
@@ -76,7 +76,7 @@ int uv_timer_init(uv_loop_t* loop, uv_timer_t* handle) {
void uv_timer_endgame(uv_loop_t* loop, uv_timer_t* handle) {
- if (handle->flags & UV_HANDLE_CLOSING) {
+ if (handle->flags & UV__HANDLE_CLOSING) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
uv__handle_close(handle);
}
diff --git a/deps/uv/src/win/tty.c b/deps/uv/src/win/tty.c
index 7a84506fde..6c9ca20550 100644
--- a/deps/uv/src/win/tty.c
+++ b/deps/uv/src/win/tty.c
@@ -152,7 +152,7 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) {
memset(&tty->last_input_record, 0, sizeof tty->last_input_record);
} else {
/* TTY output specific fields. */
- tty->flags |= UV_HANDLE_READABLE;
+ tty->flags |= UV_HANDLE_WRITABLE;
/* Init utf8-to-utf16 conversion state. */
tty->utf8_bytes_left = 0;
@@ -1011,10 +1011,10 @@ static int uv_tty_reset(uv_tty_t* handle, DWORD* error) {
count = info.dwSize.X * info.dwSize.Y;
if (!(FillConsoleOutputCharacterW(handle->handle,
- L'\x20',
- count,
- origin,
- &written) &&
+ L'\x20',
+ count,
+ origin,
+ &written) &&
FillConsoleOutputAttribute(handle->handle,
char_attrs,
written,
@@ -1813,7 +1813,7 @@ void uv_tty_endgame(uv_loop_t* loop, uv_tty_t* handle) {
/* TTY shutdown is really just a no-op */
if (handle->shutdown_req->cb) {
- if (handle->flags & UV_HANDLE_CLOSING) {
+ if (handle->flags & UV__HANDLE_CLOSING) {
uv__set_artificial_error(loop, UV_ECANCELED);
handle->shutdown_req->cb(handle->shutdown_req, -1);
} else {
@@ -1827,7 +1827,7 @@ void uv_tty_endgame(uv_loop_t* loop, uv_tty_t* handle) {
return;
}
- if (handle->flags & UV_HANDLE_CLOSING &&
+ if (handle->flags & UV__HANDLE_CLOSING &&
handle->reqs_pending == 0) {
/* The console handle duplicate used for line reading should be destroyed */
/* by uv_tty_read_stop. */
diff --git a/deps/uv/src/win/udp.c b/deps/uv/src/win/udp.c
index 5d3a547543..2436799b57 100644
--- a/deps/uv/src/win/udp.c
+++ b/deps/uv/src/win/udp.c
@@ -152,7 +152,7 @@ void uv_udp_close(uv_loop_t* loop, uv_udp_t* handle) {
void uv_udp_endgame(uv_loop_t* loop, uv_udp_t* handle) {
- if (handle->flags & UV_HANDLE_CLOSING &&
+ if (handle->flags & UV__HANDLE_CLOSING &&
handle->reqs_pending == 0) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
uv__handle_close(handle);