Lines Matching defs:handle
33 #include "handle-inl.h"
69 * it's closed. Since this handle is made non-inheritable and we're not
140 static void uv__process_init(uv_loop_t* loop, uv_process_t* handle) {
141 uv__handle_init(loop, (uv_handle_t*) handle, UV_PROCESS);
142 handle->exit_cb = NULL;
143 handle->pid = 0;
144 handle->exit_signal = 0;
145 handle->wait_handle = INVALID_HANDLE_VALUE;
146 handle->process_handle = INVALID_HANDLE_VALUE;
147 handle->child_stdio_buffer = NULL;
148 handle->exit_cb_pending = 0;
150 UV_REQ_INIT(&handle->exit_req, UV_PROCESS_EXIT);
151 handle->exit_req.data = handle;
803 if (var_size != (DWORD) (len - 1)) { /* TODO: handle race condition? */
867 void uv__process_proc_exit(uv_loop_t* loop, uv_process_t* handle) {
871 assert(handle->exit_cb_pending);
872 handle->exit_cb_pending = 0;
876 if (handle->flags & UV_HANDLE_CLOSING) {
877 uv__want_endgame(loop, (uv_handle_t*) handle);
882 if (handle->wait_handle != INVALID_HANDLE_VALUE) {
883 UnregisterWait(handle->wait_handle);
884 handle->wait_handle = INVALID_HANDLE_VALUE;
887 /* Set the handle to inactive: no callbacks will be made after the exit
889 uv__handle_stop(handle);
891 if (GetExitCodeProcess(handle->process_handle, &status)) {
899 if (handle->exit_cb) {
900 handle->exit_cb(handle, exit_code, handle->exit_signal);
905 void uv__process_close(uv_loop_t* loop, uv_process_t* handle) {
906 uv__handle_closing(handle);
908 if (handle->wait_handle != INVALID_HANDLE_VALUE) {
911 BOOL r = UnregisterWaitEx(handle->wait_handle, INVALID_HANDLE_VALUE);
917 handle->wait_handle = INVALID_HANDLE_VALUE;
920 if (!handle->exit_cb_pending) {
921 uv__want_endgame(loop, (uv_handle_t*)handle);
926 void uv__process_endgame(uv_loop_t* loop, uv_process_t* handle) {
927 assert(!handle->exit_cb_pending);
928 assert(handle->flags & UV_HANDLE_CLOSING);
929 assert(!(handle->flags & UV_HANDLE_CLOSED));
931 /* Clean-up the process handle. */
932 CloseHandle(handle->process_handle);
934 uv__handle_close(handle);
1168 /* Make the handle active. It will remain active until the exit callback is
1169 * made or the handle is closed, whichever happens first. */