Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (!QUEUE_EMPTY(&loop->watcher_queue)) {
- q = QUEUE_HEAD(&loop->watcher_queue);
- QUEUE_REMOVE(q);
- QUEUE_INIT(q);
- w = QUEUE_DATA(q, uv__io_t, watcher_queue);
- assert(w->pevents != 0);
- assert(w->fd >= 0);
- assert(w->fd < (int) loop->nwatchers);
- e.events = w->pevents;
- e.data = w->fd;
- if (w->events == 0)
- op = UV__EPOLL_CTL_ADD;
- else
- op = UV__EPOLL_CTL_MOD;
- if (uv__epoll_ctl(loop->backend_fd, op, w->fd, &e)) {
- if (errno != EEXIST)
- abort();
- if (uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_MOD, w->fd, &e))
- abort();
- }
- w->events = w->pevents;
- }
- for(;;){
- nfds = uv__epoll_wait(loop->backend_fd,
- events,
- ARRAY_SIZE(events),
- timeout);
- //... run callback for every events.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement