summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Alexander Lehmann <libev@schmorp.de>2019-12-24 13:52:58 +0000
committerMarc Alexander Lehmann <libev@schmorp.de>2019-12-24 13:52:58 +0000
commitd50877da9aa16212c9cdf7c011c5ca8b0a170da7 (patch)
tree617676d4ac327561076fd68f25731f58313381ca
parente4302f33f272fd98fc963009f22d3ef6661f94fb (diff)
downloadlibev-d50877da9aa16212c9cdf7c011c5ca8b0a170da7.tar.gz
libev-d50877da9aa16212c9cdf7c011c5ca8b0a170da7.zip
*** empty log message ***
-rw-r--r--Changes2
-rw-r--r--ev.c6
-rw-r--r--ev.h15
3 files changed, 14 insertions, 9 deletions
diff --git a/Changes b/Changes
index cf0d88f..f61ce0f 100644
--- a/Changes
+++ b/Changes
@@ -6,6 +6,8 @@ TODO: document EV_TSTAMP_T
- the new timerfd code wrongly changed the priority of ther signal
fd watcher, which is usuallys harmless unless signal fds are
also used (found via cpan tester service).
+ - support a lot more "uncommon" compile time configurations,
+ such as ev_embed enabled but ev_timer disabled.
4.31 Fri Dec 20 21:58:29 CET 2019
- handle backends with minimum wait time a bit better by not
diff --git a/ev.c b/ev.c
index ef94c9e..7be883f 100644
--- a/ev.c
+++ b/ev.c
@@ -5078,6 +5078,7 @@ embed_prepare_cb (EV_P_ ev_prepare *prepare, int revents)
}
}
+#if EV_FORK_ENABLE
static void
embed_fork_cb (EV_P_ ev_fork *fork_w, int revents)
{
@@ -5094,6 +5095,7 @@ embed_fork_cb (EV_P_ ev_fork *fork_w, int revents)
ev_embed_start (EV_A_ w);
}
+#endif
#if 0
static void
@@ -5124,8 +5126,10 @@ ev_embed_start (EV_P_ ev_embed *w) EV_NOEXCEPT
ev_set_priority (&w->prepare, EV_MINPRI);
ev_prepare_start (EV_A_ &w->prepare);
+#if EV_FORK_ENABLE
ev_fork_init (&w->fork, embed_fork_cb);
ev_fork_start (EV_A_ &w->fork);
+#endif
/*ev_idle_init (&w->idle, e,bed_idle_cb);*/
@@ -5145,7 +5149,9 @@ ev_embed_stop (EV_P_ ev_embed *w) EV_NOEXCEPT
ev_io_stop (EV_A_ &w->io);
ev_prepare_stop (EV_A_ &w->prepare);
+#if EV_FORK_ENABLE
ev_fork_stop (EV_A_ &w->fork);
+#endif
ev_stop (EV_A_ (W)w);
diff --git a/ev.h b/ev.h
index 7806f61..4a57d73 100644
--- a/ev.h
+++ b/ev.h
@@ -392,14 +392,12 @@ typedef struct ev_stat
} ev_stat;
#endif
-#if EV_IDLE_ENABLE
/* invoked when the nothing else needs to be done, keeps the process from blocking */
/* revent EV_IDLE */
typedef struct ev_idle
{
EV_WATCHER (ev_idle)
} ev_idle;
-#endif
/* invoked for each run of the mainloop, just before the blocking call */
/* you can still change events in any way you like */
@@ -416,23 +414,19 @@ typedef struct ev_check
EV_WATCHER (ev_check)
} ev_check;
-#if EV_FORK_ENABLE
/* the callback gets invoked before check in the child process when a fork was detected */
/* revent EV_FORK */
typedef struct ev_fork
{
EV_WATCHER (ev_fork)
} ev_fork;
-#endif
-#if EV_CLEANUP_ENABLE
/* is invoked just before the loop gets destroyed */
/* revent EV_CLEANUP */
typedef struct ev_cleanup
{
EV_WATCHER (ev_cleanup)
} ev_cleanup;
-#endif
#if EV_EMBED_ENABLE
/* used to embed an event loop inside another */
@@ -442,16 +436,18 @@ typedef struct ev_embed
EV_WATCHER (ev_embed)
struct ev_loop *other; /* ro */
+#undef EV_IO_ENABLE
+#define EV_IO_ENABLE 1
ev_io io; /* private */
+#undef EV_PREPARE_ENABLE
+#define EV_PREPARE_ENABLE 1
ev_prepare prepare; /* private */
ev_check check; /* unused */
ev_timer timer; /* unused */
ev_periodic periodic; /* unused */
ev_idle idle; /* unused */
ev_fork fork; /* private */
-#if EV_CLEANUP_ENABLE
ev_cleanup cleanup; /* unused */
-#endif
} ev_embed;
#endif
@@ -660,6 +656,8 @@ EV_API_DECL void ev_unref (EV_P) EV_NOEXCEPT;
*/
EV_API_DECL void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) EV_NOEXCEPT;
+EV_API_DECL void ev_invoke_pending (EV_P); /* invoke all pending watchers */
+
# if EV_FEATURE_API
EV_API_DECL unsigned int ev_iteration (EV_P) EV_NOEXCEPT; /* number of loop iterations */
EV_API_DECL unsigned int ev_depth (EV_P) EV_NOEXCEPT; /* #ev_loop enters - #ev_loop leaves */
@@ -677,7 +675,6 @@ EV_API_DECL void ev_set_invoke_pending_cb (EV_P_ ev_loop_callback invoke_pending
EV_API_DECL void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P) EV_NOEXCEPT, void (*acquire)(EV_P) EV_NOEXCEPT) EV_NOEXCEPT;
EV_API_DECL unsigned int ev_pending_count (EV_P) EV_NOEXCEPT; /* number of pending events, if any */
-EV_API_DECL void ev_invoke_pending (EV_P); /* invoke all pending watchers */
/*
* stop/start the timer handling.