… | |
… | |
570 | void |
570 | void |
571 | linuxaio_destroy (EV_P) |
571 | linuxaio_destroy (EV_P) |
572 | { |
572 | { |
573 | epoll_destroy (EV_A); |
573 | epoll_destroy (EV_A); |
574 | linuxaio_free_iocbp (EV_A); |
574 | linuxaio_free_iocbp (EV_A); |
575 | evsys_io_destroy (linuxaio_ctx); |
575 | evsys_io_destroy (linuxaio_ctx); /* fails in child, aio context is destroyed */ |
576 | } |
576 | } |
577 | |
577 | |
578 | inline_size |
578 | inline_size |
579 | void |
579 | void |
580 | linuxaio_fork (EV_P) |
580 | linuxaio_fork (EV_P) |
… | |
… | |
586 | linuxaio_iteration = 0; /* we start over in the child */ |
586 | linuxaio_iteration = 0; /* we start over in the child */ |
587 | |
587 | |
588 | while (linuxaio_io_setup (EV_A) < 0) |
588 | while (linuxaio_io_setup (EV_A) < 0) |
589 | ev_syserr ("(libev) linuxaio io_setup"); |
589 | ev_syserr ("(libev) linuxaio io_setup"); |
590 | |
590 | |
|
|
591 | /* forking epoll should also effectively unregister all fds from the backend */ |
591 | epoll_fork (EV_A); |
592 | epoll_fork (EV_A); |
592 | |
593 | |
593 | ev_io_stop (EV_A_ &linuxaio_epoll_w); |
594 | ev_io_stop (EV_A_ &linuxaio_epoll_w); |
594 | ev_io_set (EV_A_ &linuxaio_epoll_w, backend_fd, EV_READ); |
595 | ev_io_set (EV_A_ &linuxaio_epoll_w, backend_fd, EV_READ); |
595 | ev_io_start (EV_A_ &linuxaio_epoll_w); |
596 | ev_io_start (EV_A_ &linuxaio_epoll_w); |