… | |
… | |
811 | fd_intern (evpipe [1]); |
811 | fd_intern (evpipe [1]); |
812 | |
812 | |
813 | ev_io_set (&pipeev, evpipe [0], EV_READ); |
813 | ev_io_set (&pipeev, evpipe [0], EV_READ); |
814 | ev_io_start (EV_A_ &pipeev); |
814 | ev_io_start (EV_A_ &pipeev); |
815 | ev_unref (EV_A); /* watcher should not keep loop alive */ |
815 | ev_unref (EV_A); /* watcher should not keep loop alive */ |
816 | |
|
|
817 | /* in case we received the signal before we had the chance of installing a handler */ |
|
|
818 | ev_feed_event (EV_A_ &pipeev, 0); |
|
|
819 | } |
816 | } |
820 | } |
817 | } |
821 | |
818 | |
822 | void inline_size |
819 | void inline_size |
823 | evpipe_write (EV_P_ int sig, int async) |
820 | evpipe_write (EV_P_ int sig, int async) |
… | |
… | |
1221 | #endif |
1218 | #endif |
1222 | |
1219 | |
1223 | if (ev_is_active (&pipeev)) |
1220 | if (ev_is_active (&pipeev)) |
1224 | { |
1221 | { |
1225 | /* this "locks" the handlers against writing to the pipe */ |
1222 | /* this "locks" the handlers against writing to the pipe */ |
|
|
1223 | /* while we modify the fd vars */ |
|
|
1224 | gotsig = 1; |
|
|
1225 | #if EV_ASYNC_ENABLE |
1226 | gotsig = gotasync = 1; |
1226 | gotasync = 1; |
|
|
1227 | #endif |
1227 | |
1228 | |
1228 | ev_ref (EV_A); |
1229 | ev_ref (EV_A); |
1229 | ev_io_stop (EV_A_ &pipeev); |
1230 | ev_io_stop (EV_A_ &pipeev); |
1230 | close (evpipe [0]); |
1231 | close (evpipe [0]); |
1231 | close (evpipe [1]); |
1232 | close (evpipe [1]); |