mirror of
https://github.com/troglobit/libuev.git
synced 2026-11-09 16:21:13 +00:00
Refactor, simplify
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
748ebc998c
commit
856546f4c7
1 file changed
+3
-8
@@ -347,6 +347,8 @@ int uev_run(uev_ctx_t *ctx, int flags)
|
|||||||
|
|
||||||
if (!w->u.t.period)
|
if (!w->u.t.period)
|
||||||
w->u.t.timeout = 0;
|
w->u.t.timeout = 0;
|
||||||
|
if (!w->u.t.timeout)
|
||||||
|
uev_timer_stop(w);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UEV_CRON_TYPE:
|
case UEV_CRON_TYPE:
|
||||||
@@ -362,16 +364,9 @@ int uev_run(uev_ctx_t *ctx, int flags)
|
|||||||
w->u.c.when = 0;
|
w->u.c.when = 0;
|
||||||
else
|
else
|
||||||
w->u.c.when += w->u.c.interval;
|
w->u.c.when += w->u.c.interval;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (UEV_CRON_TYPE == w->type) {
|
|
||||||
if (!w->u.c.when)
|
if (!w->u.c.when)
|
||||||
uev_timer_stop(w);
|
uev_timer_stop(w);
|
||||||
}
|
break;
|
||||||
if (UEV_TIMER_TYPE == w->type) {
|
|
||||||
if (!w->u.t.timeout)
|
|
||||||
uev_timer_stop(w);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in new issue
Block a user