Lines Matching defs:loop

27 int uv__epoll_init(uv_loop_t* loop) {
41 loop->backend_fd = fd;
49 void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
55 assert(loop->watchers != NULL);
58 events = (struct epoll_event*) loop->watchers[loop->nwatchers];
59 nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1];
72 if (loop->backend_fd >= 0) {
77 epoll_ctl(loop->backend_fd, EPOLL_CTL_DEL, fd, &dummy);
82 int uv__io_check_fd(uv_loop_t* loop, int fd) {
91 if (epoll_ctl(loop->backend_fd, EPOLL_CTL_ADD, fd, &e))
96 if (epoll_ctl(loop->backend_fd, EPOLL_CTL_DEL, fd, &e))
103 void uv__io_poll(uv_loop_t* loop, int timeout) {
136 if (loop->nfds == 0) {
137 assert(QUEUE_EMPTY(&loop->watcher_queue));
143 while (!QUEUE_EMPTY(&loop->watcher_queue)) {
144 q = QUEUE_HEAD(&loop->watcher_queue);
151 assert(w->fd < (int) loop->nwatchers);
164 if (epoll_ctl(loop->backend_fd, op, w->fd, &e)) {
171 if (epoll_ctl(loop->backend_fd, EPOLL_CTL_MOD, w->fd, &e))
179 if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
186 base = loop->time;
190 if (uv__get_internal_fields(loop)->flags & UV_METRICS_IDLE_TIME) {
210 * will return early if the loop isn't configured with UV_METRICS_IDLE_TIME.
213 uv__metrics_set_provider_entry_time(loop);
226 nfds = epoll_pwait(loop->backend_fd,
236 nfds = epoll_wait(loop->backend_fd,
250 /* Update loop->time unconditionally. It's tempting to skip the update when
254 SAVE_ERRNO(uv__update_time(loop));
312 assert(loop->watchers != NULL);
313 loop->watchers[loop->nwatchers] = x.watchers;
314 loop->watchers[loop->nwatchers + 1] = (void*) (uintptr_t) nfds;
326 assert((unsigned) fd < loop->nwatchers);
328 w = loop->watchers[fd];
336 epoll_ctl(loop->backend_fd, EPOLL_CTL_DEL, fd, pe);
341 * callbacks when previous callback invocation in this loop has stopped
348 * EPOLLERR or EPOLLHUP event. In order to force the event loop to
370 if (w == &loop->signal_io_watcher) {
373 uv__metrics_update_idle_time(loop);
374 w->cb(loop, w, pe->events);
387 uv__metrics_update_idle_time(loop);
388 loop->signal_io_watcher.cb(loop, &loop->signal_io_watcher, POLLIN);
391 loop->watchers[loop->nwatchers] = NULL;
392 loop->watchers[loop->nwatchers + 1] = NULL;
395 return; /* Event loop should cycle now so don't poll again. */
415 real_timeout -= (loop->time - base);