| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b337577 commit 30a0e58
36 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -623,7 +623,7 @@ enum { | |||
| 623 | 623 | }; | |
| 624 | 624 | ||
| 625 | 625 | #if EV_PROTOTYPES | |
| 626 | - void ev_run (EV_P_ int flags EV_CPP (= 0)); | ||
| 626 | + void ev_run (EV_P_ ev_tstamp waittime); | ||
| 627 | 627 | void ev_break (EV_P_ int how EV_CPP (= EVBREAK_ONE)); /* break out of the loop */ | |
| 628 | 628 | ||
| 629 | 629 | /* | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -98,18 +98,21 @@ struct uv__io_s { | |||
| 98 | 98 | # define UV_LOOP_PRIVATE_PLATFORM_FIELDS | |
| 99 | 99 | #endif | |
| 100 | 100 | ||
| 101 | - #define UV_LOOP_PRIVATE_FIELDS \ | ||
| 102 | - /* Poll result queue */ \ | ||
| 103 | - eio_channel uv_eio_channel; \ | ||
| 104 | - struct ev_loop* ev; \ | ||
| 105 | - /* Various thing for libeio. */ \ | ||
| 106 | - uv_async_t uv_eio_want_poll_notifier; \ | ||
| 107 | - uv_async_t uv_eio_done_poll_notifier; \ | ||
| 108 | - uv_idle_t uv_eio_poller; \ | ||
| 109 | - uv_handle_t* pending_handles; \ | ||
| 110 | - ngx_queue_t prepare_handles; \ | ||
| 111 | - ngx_queue_t check_handles; \ | ||
| 112 | - ngx_queue_t idle_handles; \ | ||
| 101 | + #define UV_LOOP_PRIVATE_FIELDS \ | ||
| 102 | + /* Poll result queue */ \ | ||
| 103 | + eio_channel uv_eio_channel; \ | ||
| 104 | + struct ev_loop* ev; \ | ||
| 105 | + /* Various thing for libeio. */ \ | ||
| 106 | + uv_async_t uv_eio_want_poll_notifier; \ | ||
| 107 | + uv_async_t uv_eio_done_poll_notifier; \ | ||
| 108 | + uv_idle_t uv_eio_poller; \ | ||
| 109 | + uv_handle_t* closing_handles; \ | ||
| 110 | + ngx_queue_t prepare_handles; \ | ||
| 111 | + ngx_queue_t check_handles; \ | ||
| 112 | + ngx_queue_t idle_handles; \ | ||
| 113 | + /* RB_HEAD(uv__timers, uv_timer_s) */ \ | ||
| 114 | + struct uv__timers { struct uv_timer_s* rbh_root; } timer_handles; \ | ||
| 115 | + uint64_t time; \ | ||
| 113 | 116 | UV_LOOP_PRIVATE_PLATFORM_FIELDS | |
| 114 | 117 | ||
| 115 | 118 | #define UV_REQ_BUFSML_SIZE (4) | |
@@ -144,7 +147,7 @@ struct uv__io_s { | |||
| 144 | 147 | /* TODO: union or classes please! */ | |
| 145 | 148 | #define UV_HANDLE_PRIVATE_FIELDS \ | |
| 146 | 149 | int flags; \ | |
| 147 | - uv_handle_t* next_pending; \ | ||
| 150 | + uv_handle_t* next_closing; \ | ||
| 148 | 151 | ||
| 149 | 152 | ||
| 150 | 153 | #define UV_STREAM_PRIVATE_FIELDS \ | |
@@ -186,7 +189,7 @@ struct uv__io_s { | |||
| 186 | 189 | uv__io_t io_watcher; | |
| 187 | 190 | ||
| 188 | 191 | ||
| 189 | - /* UV_PREPARE */ \ | ||
| 192 | + /* UV_PREPARE */ | ||
| 190 | 193 | #define UV_PREPARE_PRIVATE_FIELDS \ | |
| 191 | 194 | uv_prepare_cb prepare_cb; \ | |
| 192 | 195 | ngx_queue_t queue; | |
@@ -211,9 +214,17 @@ struct uv__io_s { | |||
| 211 | 214 | ||
| 212 | 215 | ||
| 213 | 216 | /* UV_TIMER */ | |
| 214 | - #define UV_TIMER_PRIVATE_FIELDS \ | ||
| 215 | - ev_timer timer_watcher; \ | ||
| 216 | - uv_timer_cb timer_cb; | ||
| 217 | + #define UV_TIMER_PRIVATE_FIELDS \ | ||
| 218 | + /* RB_ENTRY(uv_timer_s) node; */ \ | ||
| 219 | + struct { \ | ||
| 220 | + struct uv_timer_s* rbe_left; \ | ||
| 221 | + struct uv_timer_s* rbe_right; \ | ||
| 222 | + struct uv_timer_s* rbe_parent; \ | ||
| 223 | + int rbe_color; \ | ||
| 224 | + } tree_entry; \ | ||
| 225 | + uv_timer_cb timer_cb; \ | ||
| 226 | + uint64_t timeout; \ | ||
| 227 | + uint64_t repeat; | ||
| 217 | 228 | ||
| 218 | 229 | #define UV_GETADDRINFO_PRIVATE_FIELDS \ | |
| 219 | 230 | uv_getaddrinfo_cb cb; \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -454,7 +454,7 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s); | |||
| 454 | 454 | struct uv_process_close_s { \ | |
| 455 | 455 | UV_REQ_FIELDS \ | |
| 456 | 456 | } close_req; \ | |
| 457 | - HANDLE child_stdio[3]; \ | ||
| 457 | + void* child_stdio_buffer; \ | ||
| 458 | 458 | int exit_signal; \ | |
| 459 | 459 | DWORD spawn_errno; \ | |
| 460 | 460 | HANDLE wait_handle; \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -301,6 +301,7 @@ typedef void (*uv_exit_cb)(uv_process_t*, int exit_status, int term_signal); | |||
| 301 | 301 | typedef void (*uv_fs_cb)(uv_fs_t* req); | |
| 302 | 302 | typedef void (*uv_work_cb)(uv_work_t* req); | |
| 303 | 303 | typedef void (*uv_after_work_cb)(uv_work_t* req); | |
| 304 | + typedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg); | ||
| 304 | 305 | ||
| 305 | 306 | /* | |
| 306 | 307 | * This will be called repeatedly after the uv_fs_event_t is initialized. | |
@@ -382,6 +383,7 @@ struct uv_shutdown_s { | |||
| 382 | 383 | /* read-only */ \ | |
| 383 | 384 | uv_handle_type type; \ | |
| 384 | 385 | /* private */ \ | |
| 386 | + ngx_queue_t handle_queue; \ | ||
| 385 | 387 | UV_HANDLE_PRIVATE_FIELDS \ | |
| 386 | 388 | ||
| 387 | 389 | /* The abstract base class of all handles. */ | |
@@ -407,6 +409,12 @@ UV_EXTERN size_t uv_req_size(uv_req_type type); | |||
| 407 | 409 | */ | |
| 408 | 410 | UV_EXTERN int uv_is_active(const uv_handle_t* handle); | |
| 409 | 411 | ||
| 412 | + /* | ||
| 413 | + * Walk the list of open handles. | ||
| 414 | + */ | ||
| 415 | + UV_EXTERN void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg); | ||
| 416 | + | ||
| 417 | + | ||
| 410 | 418 | /* | |
| 411 | 419 | * Request handle to be closed. close_cb will be called asynchronously after | |
| 412 | 420 | * this call. This MUST be called on each handle before memory is released. | |
@@ -1157,15 +1165,17 @@ UV_EXTERN void uv_freeaddrinfo(struct addrinfo* ai); | |||
| 1157 | 1165 | ||
| 1158 | 1166 | /* uv_spawn() options */ | |
| 1159 | 1167 | typedef enum { | |
| 1160 | - UV_IGNORE = 0x00, | ||
| 1161 | - UV_CREATE_PIPE = 0x01, | ||
| 1162 | - /* | ||
| 1163 | - * UV_READABLE_PIPE and UV_WRITABLE_PIPE flags are set from | ||
| 1164 | - * the child process perspective. | ||
| 1168 | + UV_IGNORE = 0x00, | ||
| 1169 | + UV_CREATE_PIPE = 0x01, | ||
| 1170 | + UV_INHERIT_FD = 0x02, | ||
| 1171 | + UV_INHERIT_STREAM = 0x04, | ||
| 1172 | + | ||
| 1173 | + /* When UV_CREATE_PIPE is specified, UV_READABLE_PIPE and UV_WRITABLE_PIPE | ||
| 1174 | + * determine the direction of flow, from the child process' perspective. Both | ||
| 1175 | + * flags may be specified to create a duplex data stream. | ||
| 1165 | 1176 | */ | |
| 1166 | - UV_READABLE_PIPE = 0x02, | ||
| 1167 | - UV_WRITABLE_PIPE = 0x04, | ||
| 1168 | - UV_RAW_FD = 0x08 | ||
| 1177 | + UV_READABLE_PIPE = 0x10, | ||
| 1178 | + UV_WRITABLE_PIPE = 0x20 | ||
| 1169 | 1179 | } uv_stdio_flags; | |
| 1170 | 1180 | ||
| 1171 | 1181 | typedef struct uv_stdio_container_s { | |
@@ -1211,10 +1221,16 @@ typedef struct uv_process_options_s { | |||
| 1211 | 1221 | uv_gid_t gid; | |
| 1212 | 1222 | ||
| 1213 | 1223 | /* | |
| 1214 | - * A container of stdio streams (stdin/stdout/stderr) | ||
| 1224 | + * The `stdio` field points to an array of uv_stdio_container_t structs that | ||
| 1225 | + * describe the file descriptors that will be made available to the child | ||
| 1226 | + * process. The convention is that stdio[0] points to stdin, fd 1 is used for | ||
| 1227 | + * stdout, and fd 2 is stderr. | ||
| 1228 | + * | ||
| 1229 | + * Note that on windows file descriptors greater than 2 are available to the | ||
| 1230 | + * child process only if the child processes uses the MSVCRT runtime. | ||
| 1215 | 1231 | */ | |
| 1216 | - uv_stdio_container_t* stdio; | ||
| 1217 | 1232 | int stdio_count; | |
| 1233 | + uv_stdio_container_t* stdio; | ||
| 1218 | 1234 | } uv_process_options_t; | |
| 1219 | 1235 | ||
| 1220 | 1236 | /* | |
@@ -1238,7 +1254,15 @@ enum uv_process_flags { | |||
| 1238 | 1254 | * converting the argument list into a command line string. This option is | |
| 1239 | 1255 | * only meaningful on Windows systems. On unix it is silently ignored. | |
| 1240 | 1256 | */ | |
| 1241 | - UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = (1 << 2) | ||
| 1257 | + UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = (1 << 2), | ||
| 1258 | + /* | ||
| 1259 | + * Spawn the child process in a detached state - this will make it a process | ||
| 1260 | + * group leader, and will effectively enable the child to keep running after | ||
| 1261 | + * the parent exits. Note that the child process will still keep the | ||
| 1262 | + * parent's event loop alive unless the parent process calls uv_unref() on | ||
| 1263 | + * the child's process handle. | ||
| 1264 | + */ | ||
| 1265 | + UV_PROCESS_DETACHED = (1 << 3) | ||
| 1242 | 1266 | }; | |
| 1243 | 1267 | ||
| 1244 | 1268 | /* | |
@@ -1668,6 +1692,7 @@ struct uv_loop_s { | |||
| 1668 | 1692 | uv_err_t last_err; | |
| 1669 | 1693 | /* Loop reference counting */ | |
| 1670 | 1694 | unsigned int active_handles; | |
| 1695 | + ngx_queue_t handle_queue; | ||
| 1671 | 1696 | ngx_queue_t active_reqs; | |
| 1672 | 1697 | /* User data - use this for whatever. */ | |
| 1673 | 1698 | void* data; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments