… | |
… | |
3012 | } |
3012 | } |
3013 | |
3013 | |
3014 | static void |
3014 | static void |
3015 | once_cb_io (EV_P_ ev_io *w, int revents) |
3015 | once_cb_io (EV_P_ ev_io *w, int revents) |
3016 | { |
3016 | { |
3017 | once_cb (EV_A_ (struct ev_once *)(((char *)w) - offsetof (struct ev_once, io)), revents); |
3017 | struct ev_once *once = (struct ev_once *)(((char *)w) - offsetof (struct ev_once, io)); |
|
|
3018 | |
|
|
3019 | once_cb (EV_A_ once, revents | ev_clear_pending (EV_A_ &once->to)); |
3018 | } |
3020 | } |
3019 | |
3021 | |
3020 | static void |
3022 | static void |
3021 | once_cb_to (EV_P_ ev_timer *w, int revents) |
3023 | once_cb_to (EV_P_ ev_timer *w, int revents) |
3022 | { |
3024 | { |
3023 | once_cb (EV_A_ (struct ev_once *)(((char *)w) - offsetof (struct ev_once, to)), revents); |
3025 | struct ev_once *once = (struct ev_once *)(((char *)w) - offsetof (struct ev_once, to)); |
|
|
3026 | |
|
|
3027 | once_cb (EV_A_ once, revents | ev_clear_pending (EV_A_ &once->io)); |
3024 | } |
3028 | } |
3025 | |
3029 | |
3026 | void |
3030 | void |
3027 | ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) |
3031 | ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) |
3028 | { |
3032 | { |