Created
July 26, 2012 20:25
-
-
Save mnunberg/3184296 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define pp_ev_allow_revent(l, e, revt_) \ | |
if ( ( (e)->events & revt_) != revt_ ) { \ | |
ev_io_stop(l, (e)); \ | |
ev_io_set( (e), (e)->fd, (e)->events | revt_); \ | |
ev_io_start(l, (e)); \ | |
} | |
#define pp_ev_ignore_revent(l, e, revt_) \ | |
if ((e)->events & revt_) { \ | |
ev_io_stop(l, (e)); \ | |
ev_io_set( (e), (e)->fd, ( (e)->events) & (~revt_)); \ | |
ev_io_start(l, (e)); \ | |
} | |
#define pp_ev_run_with_cb(loop, conn, cb, revents) \ | |
ev_io_init(&(conn->w), cb, conn->fd, revents); \ | |
ev_io_start(loop, &(conn->w)); | |
#define pp_ev_switch_cb(loop, conn, cb, revents) \ | |
ev_io_stop(loop, &(conn->w)); \ | |
pp_ev_run_with_cb(loop, conn, cb, revents); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment