… | |
… | |
117 | # define EV_USE_EPOLL 0 |
117 | # define EV_USE_EPOLL 0 |
118 | # endif |
118 | # endif |
119 | |
119 | |
120 | # if HAVE_LINUX_AIO_ABI_H |
120 | # if HAVE_LINUX_AIO_ABI_H |
121 | # ifndef EV_USE_LINUXAIO |
121 | # ifndef EV_USE_LINUXAIO |
122 | # define EV_USE_LINUXAIO EV_FEATURE_BACKENDS |
122 | # define EV_USE_LINUXAIO 0 /* was: EV_FEATURE_BACKENDS, always off by default */ |
123 | # endif |
123 | # endif |
124 | # else |
124 | # else |
125 | # undef EV_USE_LINUXAIO |
125 | # undef EV_USE_LINUXAIO |
126 | # define EV_USE_LINUXAIO 0 |
126 | # define EV_USE_LINUXAIO 0 |
127 | # endif |
127 | # endif |
… | |
… | |
344 | # define EV_USE_PORT 0 |
344 | # define EV_USE_PORT 0 |
345 | #endif |
345 | #endif |
346 | |
346 | |
347 | #ifndef EV_USE_LINUXAIO |
347 | #ifndef EV_USE_LINUXAIO |
348 | # if __linux /* libev currently assumes linux/aio_abi.h is always available on linux */ |
348 | # if __linux /* libev currently assumes linux/aio_abi.h is always available on linux */ |
349 | # define EV_USE_LINUXAIO 1 |
349 | # define EV_USE_LINUXAIO 0 /* was: 1, always off by default */ |
350 | # else |
350 | # else |
351 | # define EV_USE_LINUXAIO 0 |
351 | # define EV_USE_LINUXAIO 0 |
352 | # endif |
352 | # endif |
353 | #endif |
353 | #endif |
354 | |
354 | |
… | |
… | |
2913 | if (timerfd >= 0) |
2913 | if (timerfd >= 0) |
2914 | { |
2914 | { |
2915 | fd_intern (timerfd); /* just to be sure */ |
2915 | fd_intern (timerfd); /* just to be sure */ |
2916 | |
2916 | |
2917 | ev_io_init (&timerfd_w, timerfdcb, timerfd, EV_READ); |
2917 | ev_io_init (&timerfd_w, timerfdcb, timerfd, EV_READ); |
2918 | ev_set_priority (&sigfd_w, EV_MINPRI); |
2918 | ev_set_priority (&timerfd_w, EV_MINPRI); |
2919 | ev_io_start (EV_A_ &timerfd_w); |
2919 | ev_io_start (EV_A_ &timerfd_w); |
2920 | ev_unref (EV_A); /* watcher should not keep loop alive */ |
2920 | ev_unref (EV_A); /* watcher should not keep loop alive */ |
2921 | |
2921 | |
2922 | /* (re-) arm timer */ |
2922 | /* (re-) arm timer */ |
2923 | timerfdcb (EV_A_ 0, 0); |
2923 | timerfdcb (EV_A_ 0, 0); |
… | |
… | |
5076 | ev_run (EV_A_ EVRUN_NOWAIT); |
5076 | ev_run (EV_A_ EVRUN_NOWAIT); |
5077 | } |
5077 | } |
5078 | } |
5078 | } |
5079 | } |
5079 | } |
5080 | |
5080 | |
|
|
5081 | #if EV_FORK_ENABLE |
5081 | static void |
5082 | static void |
5082 | embed_fork_cb (EV_P_ ev_fork *fork_w, int revents) |
5083 | embed_fork_cb (EV_P_ ev_fork *fork_w, int revents) |
5083 | { |
5084 | { |
5084 | ev_embed *w = (ev_embed *)(((char *)fork_w) - offsetof (ev_embed, fork)); |
5085 | ev_embed *w = (ev_embed *)(((char *)fork_w) - offsetof (ev_embed, fork)); |
5085 | |
5086 | |
… | |
… | |
5092 | ev_run (EV_A_ EVRUN_NOWAIT); |
5093 | ev_run (EV_A_ EVRUN_NOWAIT); |
5093 | } |
5094 | } |
5094 | |
5095 | |
5095 | ev_embed_start (EV_A_ w); |
5096 | ev_embed_start (EV_A_ w); |
5096 | } |
5097 | } |
|
|
5098 | #endif |
5097 | |
5099 | |
5098 | #if 0 |
5100 | #if 0 |
5099 | static void |
5101 | static void |
5100 | embed_idle_cb (EV_P_ ev_idle *idle, int revents) |
5102 | embed_idle_cb (EV_P_ ev_idle *idle, int revents) |
5101 | { |
5103 | { |
… | |
… | |
5122 | |
5124 | |
5123 | ev_prepare_init (&w->prepare, embed_prepare_cb); |
5125 | ev_prepare_init (&w->prepare, embed_prepare_cb); |
5124 | ev_set_priority (&w->prepare, EV_MINPRI); |
5126 | ev_set_priority (&w->prepare, EV_MINPRI); |
5125 | ev_prepare_start (EV_A_ &w->prepare); |
5127 | ev_prepare_start (EV_A_ &w->prepare); |
5126 | |
5128 | |
|
|
5129 | #if EV_FORK_ENABLE |
5127 | ev_fork_init (&w->fork, embed_fork_cb); |
5130 | ev_fork_init (&w->fork, embed_fork_cb); |
5128 | ev_fork_start (EV_A_ &w->fork); |
5131 | ev_fork_start (EV_A_ &w->fork); |
|
|
5132 | #endif |
5129 | |
5133 | |
5130 | /*ev_idle_init (&w->idle, e,bed_idle_cb);*/ |
5134 | /*ev_idle_init (&w->idle, e,bed_idle_cb);*/ |
5131 | |
5135 | |
5132 | ev_start (EV_A_ (W)w, 1); |
5136 | ev_start (EV_A_ (W)w, 1); |
5133 | |
5137 | |
… | |
… | |
5143 | |
5147 | |
5144 | EV_FREQUENT_CHECK; |
5148 | EV_FREQUENT_CHECK; |
5145 | |
5149 | |
5146 | ev_io_stop (EV_A_ &w->io); |
5150 | ev_io_stop (EV_A_ &w->io); |
5147 | ev_prepare_stop (EV_A_ &w->prepare); |
5151 | ev_prepare_stop (EV_A_ &w->prepare); |
|
|
5152 | #if EV_FORK_ENABLE |
5148 | ev_fork_stop (EV_A_ &w->fork); |
5153 | ev_fork_stop (EV_A_ &w->fork); |
|
|
5154 | #endif |
5149 | |
5155 | |
5150 | ev_stop (EV_A_ (W)w); |
5156 | ev_stop (EV_A_ (W)w); |
5151 | |
5157 | |
5152 | EV_FREQUENT_CHECK; |
5158 | EV_FREQUENT_CHECK; |
5153 | } |
5159 | } |