summaryrefslogtreecommitdiff
path: root/adapters/libev.h
diff options
context:
space:
mode:
authorsundb <sundbcn@gmail.com>2021-12-16 17:42:58 +0800
committerGitHub <noreply@github.com>2021-12-16 17:42:58 +0800
commitc6657ef65bacc989a5ae1462062d41547fa84765 (patch)
tree859dfe063b7755339425c9ebbab3bdc55b4bf95f /adapters/libev.h
parentfd033e983acb69f7814255e7836f255411e17007 (diff)
parentda5a4ff3622e8744b772a76f6ce580dc9134fb38 (diff)
Merge branch 'redis:master' into master
Diffstat (limited to 'adapters/libev.h')
-rw-r--r--adapters/libev.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/adapters/libev.h b/adapters/libev.h
index 6191543..c59d3da 100644
--- a/adapters/libev.h
+++ b/adapters/libev.h
@@ -66,8 +66,9 @@ static void redisLibevWriteEvent(EV_P_ ev_io *watcher, int revents) {
static void redisLibevAddRead(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
if (!e->reading) {
e->reading = 1;
ev_io_start(EV_A_ &e->rev);
@@ -76,8 +77,9 @@ static void redisLibevAddRead(void *privdata) {
static void redisLibevDelRead(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
if (e->reading) {
e->reading = 0;
ev_io_stop(EV_A_ &e->rev);
@@ -86,8 +88,9 @@ static void redisLibevDelRead(void *privdata) {
static void redisLibevAddWrite(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
if (!e->writing) {
e->writing = 1;
ev_io_start(EV_A_ &e->wev);
@@ -96,8 +99,9 @@ static void redisLibevAddWrite(void *privdata) {
static void redisLibevDelWrite(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
if (e->writing) {
e->writing = 0;
ev_io_stop(EV_A_ &e->wev);
@@ -106,8 +110,9 @@ static void redisLibevDelWrite(void *privdata) {
static void redisLibevStopTimer(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
ev_timer_stop(EV_A_ &e->timer);
}
@@ -120,6 +125,9 @@ static void redisLibevCleanup(void *privdata) {
}
static void redisLibevTimeout(EV_P_ ev_timer *timer, int revents) {
+#if EV_MULTIPLICITY
+ ((void)EV_A);
+#endif
((void)revents);
redisLibevEvents *e = (redisLibevEvents*)timer->data;
redisAsyncHandleTimeout(e->context);
@@ -127,8 +135,9 @@ static void redisLibevTimeout(EV_P_ ev_timer *timer, int revents) {
static void redisLibevSetTimeout(void *privdata, struct timeval tv) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
if (!ev_is_active(&e->timer)) {
ev_init(&e->timer, redisLibevTimeout);