From b3713de7cefa87af9ed95d091db497cef63502d0 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 29 Aug 2019 13:06:23 +0100 Subject: [Fix] Fix pending checks for events --- contrib/libev/ev.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib/libev') diff --git a/contrib/libev/ev.h b/contrib/libev/ev.h index b27a2fdad..4b7503d3d 100644 --- a/contrib/libev/ev.h +++ b/contrib/libev/ev.h @@ -705,6 +705,8 @@ EV_API_DECL void ev_resume (EV_P) EV_NOEXCEPT; #define ev_is_pending(ev) (0 + ((ev_watcher *)(void *)(ev))->pending) /* ro, true when watcher is waiting for callback invocation */ #define ev_is_active(ev) (0 + ((ev_watcher *)(void *)(ev))->active) /* ro, true when the watcher has been started */ +#define ev_can_stop(ev) (ev_is_pending(ev) || ev_is_active(ev)) /* ro, true when the watcher has been started */ + #define ev_cb_(ev) (ev)->cb /* rw */ #define ev_cb(ev) (memmove (&ev_cb_ (ev), &((ev_watcher *)(ev))->cb, sizeof (ev_cb_ (ev))), (ev)->cb) -- cgit v1.2.3