28 #if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR)
43 #if defined(_DEBUG) && (defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR))
50 static int uv__crt_dbg_report_handler(
int report_type,
char *
message,
int *ret_val) {
59 if(IsDebuggerPresent())
73 #if !defined(__MINGW32__) || __MSVCRT_VERSION__ >= 0x800
75 const wchar_t*
function,
const wchar_t *
file,
unsigned int line,
84 #define UV__LOOPS_CHUNK_SIZE 8
101 goto failed_loops_realloc;
113 failed_loops_realloc:
115 return ERROR_OUTOFMEMORY;
120 int smaller_capacity;
171 PostQueuedCompletionStatus(
loop->iocp, 0, 0,
NULL);
178 SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX |
179 SEM_NOOPENFILEERRORBOX);
184 #if !defined(__MINGW32__) || __MSVCRT_VERSION__ >= 0x800
192 #if defined(_DEBUG) && (defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR))
193 _CrtSetReportHook(uv__crt_dbg_report_handler);
244 goto fail_metrics_mutex_init;
264 goto fail_timers_alloc;
277 memset(&
loop->poll_peer_sockets, 0,
sizeof loop->poll_peer_sockets);
279 loop->active_tcp_streams = 0;
280 loop->active_udp_streams = 0;
282 loop->timer_counter = 0;
287 goto fail_mutex_init;
291 goto fail_async_init;
298 goto fail_async_init;
312 fail_metrics_mutex_init:
315 CloseHandle(
loop->iocp);
325 loop->time = new_time;
346 loop->wq_async.async_sent = 0;
352 SOCKET sock =
loop->poll_peer_sockets[
i];
353 if (sock != 0 && sock != INVALID_SOCKET)
371 CloseHandle(
loop->iocp);
405 if (
loop->pending_reqs_tail)
408 if (
loop->endgame_handles)
411 if (
loop->idle_handles)
421 OVERLAPPED* overlapped;
445 GetQueuedCompletionStatus(
loop->iocp,
451 if (reset_timeout != 0) {
472 }
else if (GetLastError() != WAIT_TIMEOUT) {
480 if (timeout_time >
loop->time) {
500 OVERLAPPED_ENTRY overlappeds[128];
532 if (reset_timeout != 0) {
549 if (overlappeds[
i].lpOverlapped) {
559 }
else if (GetLastError() != WAIT_TIMEOUT) {
567 if (timeout_time >
loop->time) {
703 if (
handle->type == UV_TCP)
705 else if (
handle->type == UV_UDP)
710 len =
sizeof(*value);
717 if (
r == SOCKET_ERROR)
724 return (
int)(
sizeof(DWORD_PTR) * 8);
743 result = func((SOCKET)
fd,
name, namelen);
uint64_t uv__hrtime(uv_clocktype_t type)
static mcore_handle handle
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec req
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd socket
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
void uv__init_detect_system_wakeup(void)
void uv_fatal_error(const int errorno, const char *syscall)
static INLINE void uv_process_endgames(uv_loop_t *loop)
#define uv__handle_close(handle)
#define uv__handle_closing(handle)
#define INVALID_HANDLE_VALUE
return memset(p, 0, total)
assert(limit<=UINT32_MAX/2)
static void repeat(struct parse *, sopno, int, int)
static INLINE void uv_insert_pending_req(uv_loop_t *loop, uv_req_t *req)
static INLINE int uv_process_reqs(uv_loop_t *loop)
static INLINE uv_req_t * uv_overlapped_to_req(OVERLAPPED *overlapped)
static struct sockaddr static addrlen static backlog const void static flags void flags
_W64 unsigned int uintptr_t
uv__loop_metrics_t loop_metrics
union uv_loop_s::@400 active_reqs
unsigned int active_handles
void uv_update_time(uv_loop_t *loop)
int uv_fileno(const uv_handle_t *handle, uv_os_fd_t *fd)
int uv_backend_timeout(const uv_loop_t *loop)
int uv_loop_alive(const uv_loop_t *loop)
int uv_is_closing(const uv_handle_t *handle)
int uv__getsockpeername(const uv_handle_t *handle, uv__peersockfunc func, struct sockaddr *name, int *namelen)
int uv_run(uv_loop_t *loop, uv_run_mode mode)
int uv__socket_sockopt(uv_handle_t *handle, int optname, int *value)
int uv_backend_fd(const uv_loop_t *loop)
int uv_translate_sys_error(int sys_errno)
int(* uv__peersockfunc)(int, struct sockaddr *, socklen_t *)
int uv__loop_configure(uv_loop_t *loop, uv_loop_option option, va_list ap)
static void uv__loops_remove(uv_loop_t *loop)
int uv_loop_fork(uv_loop_t *loop)
static void uv_init(void)
static int uv__loops_add(uv_loop_t *loop)
static int uv__loops_capacity
static int uv__loops_size
int uv_cpumask_size(void)
#define UV__LOOPS_CHUNK_SIZE
static uv_mutex_t uv__loops_lock
static uv_once_t uv_init_guard_
static uv_loop_t ** uv__loops
static void uv__poll(uv_loop_t *loop, DWORD timeout)
static void uv__poll_wine(uv_loop_t *loop, DWORD timeout)
int uv_loop_init(uv_loop_t *loop)
static void uv__crt_invalid_parameter_handler(const wchar_t *expression, const wchar_t *function, const wchar_t *file, unsigned int line, uintptr_t reserved)
static int uv__loop_alive(const uv_loop_t *loop)
UV_THREAD_LOCAL int uv__crt_assert_enabled
void uv__wake_all_loops(void)
void uv__loop_close(uv_loop_t *loop)
static void uv__loops_init(void)
void uv_winapi_init(void)
void uv_prepare_invoke(uv_loop_t *loop)
void uv_check_invoke(uv_loop_t *loop)
void uv_winsock_init(void)
void uv_console_init(void)
void uv_signals_init(void)
void uv_idle_invoke(uv_loop_t *loop)
void uv__work_done(uv_async_t *handle)
int uv__next_timeout(const uv_loop_t *loop)
static struct heap * timer_heap(const uv_loop_t *loop)
void uv__run_timers(uv_loop_t *loop)
pthread_mutex_t uv_mutex_t
void * uv__realloc(void *ptr, size_t size)
void * uv__malloc(size_t size)
void * uv__calloc(size_t count, size_t size)
void uv__metrics_update_idle_time(uv_loop_t *loop)
void uv__metrics_set_provider_entry_time(uv_loop_t *loop)
#define uv__handle_unref(h)
#define uv__has_active_handles(loop)
#define uv__has_active_reqs(loop)
#define uv__get_internal_fields(loop)
UV_EXTERN void uv_mutex_lock(uv_mutex_t *handle)
UV_EXTERN void uv_once(uv_once_t *guard, void(*callback)(void))
UV_EXTERN void uv_mutex_destroy(uv_mutex_t *handle)
UV_EXTERN void uv_mutex_unlock(uv_mutex_t *handle)
UV_EXTERN int uv_async_init(uv_loop_t *, uv_async_t *async, uv_async_cb async_cb)
UV_EXTERN int uv_mutex_init(uv_mutex_t *handle)
sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx
static const z80_opcode fd[]