Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
uv: upgrade to 87dbffbd
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus authored and indutny committed Jun 1, 2012
1 parent b337577 commit 30a0e58
Show file tree
Hide file tree
Showing 36 changed files with 914 additions and 597 deletions.
2 changes: 1 addition & 1 deletion deps/uv/include/uv-private/ev.h
Expand Up @@ -623,7 +623,7 @@ enum {
};

#if EV_PROTOTYPES
void ev_run (EV_P_ int flags EV_CPP (= 0));
void ev_run (EV_P_ ev_tstamp waittime);
void ev_break (EV_P_ int how EV_CPP (= EVBREAK_ONE)); /* break out of the loop */

/*
Expand Down
45 changes: 28 additions & 17 deletions deps/uv/include/uv-private/uv-unix.h
Expand Up @@ -98,18 +98,21 @@ struct uv__io_s {
# define UV_LOOP_PRIVATE_PLATFORM_FIELDS
#endif

#define UV_LOOP_PRIVATE_FIELDS \
/* Poll result queue */ \
eio_channel uv_eio_channel; \
struct ev_loop* ev; \
/* Various thing for libeio. */ \
uv_async_t uv_eio_want_poll_notifier; \
uv_async_t uv_eio_done_poll_notifier; \
uv_idle_t uv_eio_poller; \
uv_handle_t* pending_handles; \
ngx_queue_t prepare_handles; \
ngx_queue_t check_handles; \
ngx_queue_t idle_handles; \
#define UV_LOOP_PRIVATE_FIELDS \
/* Poll result queue */ \
eio_channel uv_eio_channel; \
struct ev_loop* ev; \
/* Various thing for libeio. */ \
uv_async_t uv_eio_want_poll_notifier; \
uv_async_t uv_eio_done_poll_notifier; \
uv_idle_t uv_eio_poller; \
uv_handle_t* closing_handles; \
ngx_queue_t prepare_handles; \
ngx_queue_t check_handles; \
ngx_queue_t idle_handles; \
/* RB_HEAD(uv__timers, uv_timer_s) */ \
struct uv__timers { struct uv_timer_s* rbh_root; } timer_handles; \
uint64_t time; \
UV_LOOP_PRIVATE_PLATFORM_FIELDS

#define UV_REQ_BUFSML_SIZE (4)
Expand Down Expand Up @@ -144,7 +147,7 @@ struct uv__io_s {
/* TODO: union or classes please! */
#define UV_HANDLE_PRIVATE_FIELDS \
int flags; \
uv_handle_t* next_pending; \
uv_handle_t* next_closing; \


#define UV_STREAM_PRIVATE_FIELDS \
Expand Down Expand Up @@ -186,7 +189,7 @@ struct uv__io_s {
uv__io_t io_watcher;


/* UV_PREPARE */ \
/* UV_PREPARE */
#define UV_PREPARE_PRIVATE_FIELDS \
uv_prepare_cb prepare_cb; \
ngx_queue_t queue;
Expand All @@ -211,9 +214,17 @@ struct uv__io_s {


/* UV_TIMER */
#define UV_TIMER_PRIVATE_FIELDS \
ev_timer timer_watcher; \
uv_timer_cb timer_cb;
#define UV_TIMER_PRIVATE_FIELDS \
/* RB_ENTRY(uv_timer_s) node; */ \
struct { \
struct uv_timer_s* rbe_left; \
struct uv_timer_s* rbe_right; \
struct uv_timer_s* rbe_parent; \
int rbe_color; \
} tree_entry; \
uv_timer_cb timer_cb; \
uint64_t timeout; \
uint64_t repeat;

#define UV_GETADDRINFO_PRIVATE_FIELDS \
uv_getaddrinfo_cb cb; \
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/include/uv-private/uv-win.h
Expand Up @@ -454,7 +454,7 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
struct uv_process_close_s { \
UV_REQ_FIELDS \
} close_req; \
HANDLE child_stdio[3]; \
void* child_stdio_buffer; \
int exit_signal; \
DWORD spawn_errno; \
HANDLE wait_handle; \
Expand Down
47 changes: 36 additions & 11 deletions deps/uv/include/uv.h
Expand Up @@ -301,6 +301,7 @@ typedef void (*uv_exit_cb)(uv_process_t*, int exit_status, int term_signal);
typedef void (*uv_fs_cb)(uv_fs_t* req);
typedef void (*uv_work_cb)(uv_work_t* req);
typedef void (*uv_after_work_cb)(uv_work_t* req);
typedef void (*uv_walk_cb)(uv_handle_t* handle, void* arg);

/*
* This will be called repeatedly after the uv_fs_event_t is initialized.
Expand Down Expand Up @@ -382,6 +383,7 @@ struct uv_shutdown_s {
/* read-only */ \
uv_handle_type type; \
/* private */ \
ngx_queue_t handle_queue; \
UV_HANDLE_PRIVATE_FIELDS \

/* The abstract base class of all handles. */
Expand All @@ -407,6 +409,12 @@ UV_EXTERN size_t uv_req_size(uv_req_type type);
*/
UV_EXTERN int uv_is_active(const uv_handle_t* handle);

/*
* Walk the list of open handles.
*/
UV_EXTERN void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg);


/*
* Request handle to be closed. close_cb will be called asynchronously after
* this call. This MUST be called on each handle before memory is released.
Expand Down Expand Up @@ -1157,15 +1165,17 @@ UV_EXTERN void uv_freeaddrinfo(struct addrinfo* ai);

/* uv_spawn() options */
typedef enum {
UV_IGNORE = 0x00,
UV_CREATE_PIPE = 0x01,
/*
* UV_READABLE_PIPE and UV_WRITABLE_PIPE flags are set from
* the child process perspective.
UV_IGNORE = 0x00,
UV_CREATE_PIPE = 0x01,
UV_INHERIT_FD = 0x02,
UV_INHERIT_STREAM = 0x04,

/* When UV_CREATE_PIPE is specified, UV_READABLE_PIPE and UV_WRITABLE_PIPE
* determine the direction of flow, from the child process' perspective. Both
* flags may be specified to create a duplex data stream.
*/
UV_READABLE_PIPE = 0x02,
UV_WRITABLE_PIPE = 0x04,
UV_RAW_FD = 0x08
UV_READABLE_PIPE = 0x10,
UV_WRITABLE_PIPE = 0x20
} uv_stdio_flags;

typedef struct uv_stdio_container_s {
Expand Down Expand Up @@ -1211,10 +1221,16 @@ typedef struct uv_process_options_s {
uv_gid_t gid;

/*
* A container of stdio streams (stdin/stdout/stderr)
* The `stdio` field points to an array of uv_stdio_container_t structs that
* describe the file descriptors that will be made available to the child
* process. The convention is that stdio[0] points to stdin, fd 1 is used for
* stdout, and fd 2 is stderr.
*
* Note that on windows file descriptors greater than 2 are available to the
* child process only if the child processes uses the MSVCRT runtime.
*/
uv_stdio_container_t* stdio;
int stdio_count;
uv_stdio_container_t* stdio;
} uv_process_options_t;

/*
Expand All @@ -1238,7 +1254,15 @@ enum uv_process_flags {
* converting the argument list into a command line string. This option is
* only meaningful on Windows systems. On unix it is silently ignored.
*/
UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = (1 << 2)
UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS = (1 << 2),
/*
* Spawn the child process in a detached state - this will make it a process
* group leader, and will effectively enable the child to keep running after
* the parent exits. Note that the child process will still keep the
* parent's event loop alive unless the parent process calls uv_unref() on
* the child's process handle.
*/
UV_PROCESS_DETACHED = (1 << 3)
};

/*
Expand Down Expand Up @@ -1668,6 +1692,7 @@ struct uv_loop_s {
uv_err_t last_err;
/* Loop reference counting */
unsigned int active_handles;
ngx_queue_t handle_queue;
ngx_queue_t active_reqs;
/* User data - use this for whatever. */
void* data;
Expand Down

0 comments on commit 30a0e58

Please sign in to comment.