Commit 698517c8 authored by Jason Madden's avatar Jason Madden

Update to libev 4.25

parent b55a62e3
......@@ -26,6 +26,9 @@
- Upgrade libuv from 1.24.0 to 1.27.0.
- Upgrade libev from 4.23 to 4.25 and update its embedded
``config.guess`` to the latest.
- dnspython >= 1.16.0 is now required for the dnspython resolver.
- Python 3.7 subprocess: Copy a ``STARTUPINFO`` passed as a parameter.
......
......@@ -7,7 +7,28 @@
XXX: We need a patch for that.
Updating libev
==============
Download and unpack the tarball into libev/. Remove these extra
files::
rm -f libev/Makefile.am
rm -f libev/Symbols.ev
rm -f libev/Symbols.event
rm -f libev/TODO
rm -f libev/aclocal.m4
rm -f libev/autogen.sh
rm -f libev/compile
rm -f libev/configure.ac
rm -f libev/libev.m4
rm -f libev/mkinstalldirs
Check if 'config.guess' and/or 'config.sub' went backwards in time
(the 'timestamp' and copyright dates'). If so, revert it (or update
from the latest source
http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree )
Updating libuv
==============
......
Revision history for libev, a high-performance and full-featured event loop.
4.25 Fri Dec 21 07:49:20 CET 2018
- INCOMPATIBLE CHANGE: EV_THROW was renamed to EV_NOEXCEPT
(EV_THROW sitll provided) and now uses noexcept on C++11 or newer.
- move the darwin select workaround highe rin ev.c, as newer versions of
darwin managed to break their broken select even more.
- ANDROID => __ANDROID__ (reported by enh@google.com).
- disable epoll_create1 on android because it has broken header files
and google is unwilling to fix them (reported by enh@google.com).
- avoid a minor compilation warning on win32.
- c++: remove deprecated dynamic throw() specifications.
- c++: improve the (unsupported) bad_loop exception class.
- backport perl ev_periodic example to C, untested.
- update libecb, biggets change is to include a memory fence
in ECB_MEMORY_FENCE_RELEASE on x86/amd64.
- minor autoconf/automake modernisation.
4.24 Wed Dec 28 05:19:55 CET 2016
- bump version to 4.24, as the release tarball inexplicably
didn't have the right version in ev.h, even though the cvs-tagged
version did have the right one (reported by Ales Teska).
4.23 Wed Nov 16 18:23:41 CET 2016
- move some declarations at the beginning to help certain retarded
microsoft compilers, even though their documentation claims
......
......@@ -269,6 +269,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
......
This diff is collapsed.
......@@ -93,8 +93,7 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29)
.\"
.\" Standard preamble:
.\" ========================================================================
......@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "LIBEV 3"
.TH LIBEV 3 "2016-11-16" "libev-4.23" "libev - high performance full featured event loop"
.TH LIBEV 3 "2018-12-21" "libev-4.25" "libev - high performance full featured event loop"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
......@@ -538,9 +538,10 @@ make libev check for a fork in each iteration by enabling this flag.
This works by calling \f(CW\*(C`getpid ()\*(C'\fR on every iteration of the loop,
and thus this might slow down your event loop if you do a lot of loop
iterations and little real work, but is usually not noticeable (on my
GNU/Linux system for example, \f(CW\*(C`getpid\*(C'\fR is actually a simple 5\-insn sequence
without a system call and thus \fIvery\fR fast, but my GNU/Linux system also has
\&\f(CW\*(C`pthread_atfork\*(C'\fR which is even faster).
GNU/Linux system for example, \f(CW\*(C`getpid\*(C'\fR is actually a simple 5\-insn
sequence without a system call and thus \fIvery\fR fast, but my GNU/Linux
system also has \f(CW\*(C`pthread_atfork\*(C'\fR which is even faster). (Update: glibc
versions 2.25 apparently removed the \f(CW\*(C`getpid\*(C'\fR optimisation again).
.Sp
The big advantage of this flag is that you can forget about fork (and
forget about forgetting to tell libev about forking, although you still
......@@ -2252,11 +2253,11 @@ deterministic behaviour in this case (you can do nothing against
.IP "ev_timer_set (ev_timer *, ev_tstamp after, ev_tstamp repeat)" 4
.IX Item "ev_timer_set (ev_timer *, ev_tstamp after, ev_tstamp repeat)"
.PD
Configure the timer to trigger after \f(CW\*(C`after\*(C'\fR seconds. If \f(CW\*(C`repeat\*(C'\fR
is \f(CW0.\fR, then it will automatically be stopped once the timeout is
reached. If it is positive, then the timer will automatically be
configured to trigger again \f(CW\*(C`repeat\*(C'\fR seconds later, again, and again,
until stopped manually.
Configure the timer to trigger after \f(CW\*(C`after\*(C'\fR seconds (fractional and
negative values are supported). If \f(CW\*(C`repeat\*(C'\fR is \f(CW0.\fR, then it will
automatically be stopped once the timeout is reached. If it is positive,
then the timer will automatically be configured to trigger again \f(CW\*(C`repeat\*(C'\fR
seconds later, again, and again, until stopped manually.
.Sp
The timer itself will do a best-effort at avoiding drift, that is, if
you configure a timer to trigger every 10 seconds, then it will normally
......@@ -2363,8 +2364,8 @@ it, as it uses a relative timeout).
.PP
\&\f(CW\*(C`ev_periodic\*(C'\fR watchers can also be used to implement vastly more complex
timers, such as triggering an event on each \*(L"midnight, local time\*(R", or
other complicated rules. This cannot be done with \f(CW\*(C`ev_timer\*(C'\fR watchers, as
those cannot react to time jumps.
other complicated rules. This cannot easily be done with \f(CW\*(C`ev_timer\*(C'\fR
watchers, as those cannot react to time jumps.
.PP
As with timers, the callback is guaranteed to be invoked only when the
point in time where it is supposed to trigger has passed. If multiple
......@@ -2463,10 +2464,30 @@ might be called at other times, too.
equal to the passed \f(CI\*(C`now\*(C'\fI value\fR.
.Sp
This can be used to create very complex timers, such as a timer that
triggers on \*(L"next midnight, local time\*(R". To do this, you would calculate the
next midnight after \f(CW\*(C`now\*(C'\fR and return the timestamp value for this. How
you do this is, again, up to you (but it is not trivial, which is the main
reason I omitted it as an example).
triggers on \*(L"next midnight, local time\*(R". To do this, you would calculate
the next midnight after \f(CW\*(C`now\*(C'\fR and return the timestamp value for
this. Here is a (completely untested, no error checking) example on how to
do this:
.Sp
.Vb 1
\& #include <time.h>
\&
\& static ev_tstamp
\& my_rescheduler (ev_periodic *w, ev_tstamp now)
\& {
\& time_t tnow = (time_t)now;
\& struct tm tm;
\& localtime_r (&tnow, &tm);
\&
\& tm.tm_sec = tm.tm_min = tm.tm_hour = 0; // midnight current day
\& ++tm.tm_mday; // midnight next day
\&
\& return mktime (&tm);
\& }
.Ve
.Sp
Note: this code might run into trouble on days that have more then two
midnights (beginning and end).
.RE
.RS 4
.RE
......@@ -3646,8 +3667,8 @@ notification, and the callback being invoked.
.SH "OTHER FUNCTIONS"
.IX Header "OTHER FUNCTIONS"
There are some other functions of possible interest. Described. Here. Now.
.IP "ev_once (loop, int fd, int events, ev_tstamp timeout, callback)" 4
.IX Item "ev_once (loop, int fd, int events, ev_tstamp timeout, callback)"
.IP "ev_once (loop, int fd, int events, ev_tstamp timeout, callback, arg)" 4
.IX Item "ev_once (loop, int fd, int events, ev_tstamp timeout, callback, arg)"
This function combines a simple timer and an I/O watcher, calls your
callback on whichever event happens first and automatically stops both
watchers. This is useful if you want to wait for a single event on an fd
......@@ -4107,15 +4128,15 @@ libev sources can be compiled as \*(C+. Therefore, code that uses the C \s-1API\
will work fine.
.PP
Proper exception specifications might have to be added to callbacks passed
to libev: exceptions may be thrown only from watcher callbacks, all
other callbacks (allocator, syserr, loop acquire/release and periodic
reschedule callbacks) must not throw exceptions, and might need a \f(CW\*(C`throw
()\*(C'\fR specification. If you have code that needs to be compiled as both C
and \*(C+ you can use the \f(CW\*(C`EV_THROW\*(C'\fR macro for this:
to libev: exceptions may be thrown only from watcher callbacks, all other
callbacks (allocator, syserr, loop acquire/release and periodic reschedule
callbacks) must not throw exceptions, and might need a \f(CW\*(C`noexcept\*(C'\fR
specification. If you have code that needs to be compiled as both C and
\&\*(C+ you can use the \f(CW\*(C`EV_NOEXCEPT\*(C'\fR macro for this:
.PP
.Vb 6
\& static void
\& fatal_error (const char *msg) EV_THROW
\& fatal_error (const char *msg) EV_NOEXCEPT
\& {
\& perror (msg);
\& abort ();
......@@ -4523,11 +4544,11 @@ in your include path (e.g. in libev/ when using \-Ilibev):
\&
\& ev_win32.c required on win32 platforms only
\&
\& ev_select.c only when select backend is enabled (which is enabled by default)
\& ev_poll.c only when poll backend is enabled (disabled by default)
\& ev_epoll.c only when the epoll backend is enabled (disabled by default)
\& ev_kqueue.c only when the kqueue backend is enabled (disabled by default)
\& ev_port.c only when the solaris port backend is enabled (disabled by default)
\& ev_select.c only when select backend is enabled
\& ev_poll.c only when poll backend is enabled
\& ev_epoll.c only when the epoll backend is enabled
\& ev_kqueue.c only when the kqueue backend is enabled
\& ev_port.c only when the solaris port backend is enabled
.Ve
.PP
\&\fIev.c\fR includes the backend files directly when enabled, so you only need
......
This diff is collapsed.
This diff is collapsed.
......@@ -413,9 +413,10 @@ make libev check for a fork in each iteration by enabling this flag.
This works by calling C<getpid ()> on every iteration of the loop,
and thus this might slow down your event loop if you do a lot of loop
iterations and little real work, but is usually not noticeable (on my
GNU/Linux system for example, C<getpid> is actually a simple 5-insn sequence
without a system call and thus I<very> fast, but my GNU/Linux system also has
C<pthread_atfork> which is even faster).
GNU/Linux system for example, C<getpid> is actually a simple 5-insn
sequence without a system call and thus I<very> fast, but my GNU/Linux
system also has C<pthread_atfork> which is even faster). (Update: glibc
versions 2.25 apparently removed the C<getpid> optimisation again).
The big advantage of this flag is that you can forget about fork (and
forget about forgetting to tell libev about forking, although you still
......@@ -2115,11 +2116,11 @@ C<SIGSTOP>).
=item ev_timer_set (ev_timer *, ev_tstamp after, ev_tstamp repeat)
Configure the timer to trigger after C<after> seconds. If C<repeat>
is C<0.>, then it will automatically be stopped once the timeout is
reached. If it is positive, then the timer will automatically be
configured to trigger again C<repeat> seconds later, again, and again,
until stopped manually.
Configure the timer to trigger after C<after> seconds (fractional and
negative values are supported). If C<repeat> is C<0.>, then it will
automatically be stopped once the timeout is reached. If it is positive,
then the timer will automatically be configured to trigger again C<repeat>
seconds later, again, and again, until stopped manually.
The timer itself will do a best-effort at avoiding drift, that is, if
you configure a timer to trigger every 10 seconds, then it will normally
......@@ -2226,8 +2227,8 @@ it, as it uses a relative timeout).
C<ev_periodic> watchers can also be used to implement vastly more complex
timers, such as triggering an event on each "midnight, local time", or
other complicated rules. This cannot be done with C<ev_timer> watchers, as
those cannot react to time jumps.
other complicated rules. This cannot easily be done with C<ev_timer>
watchers, as those cannot react to time jumps.
As with timers, the callback is guaranteed to be invoked only when the
point in time where it is supposed to trigger has passed. If multiple
......@@ -2323,10 +2324,28 @@ NOTE: I<< This callback must always return a time that is higher than or
equal to the passed C<now> value >>.
This can be used to create very complex timers, such as a timer that
triggers on "next midnight, local time". To do this, you would calculate the
next midnight after C<now> and return the timestamp value for this. How
you do this is, again, up to you (but it is not trivial, which is the main
reason I omitted it as an example).
triggers on "next midnight, local time". To do this, you would calculate
the next midnight after C<now> and return the timestamp value for
this. Here is a (completely untested, no error checking) example on how to
do this:
#include <time.h>
static ev_tstamp
my_rescheduler (ev_periodic *w, ev_tstamp now)
{
time_t tnow = (time_t)now;
struct tm tm;
localtime_r (&tnow, &tm);
tm.tm_sec = tm.tm_min = tm.tm_hour = 0; // midnight current day
++tm.tm_mday; // midnight next day
return mktime (&tm);
}
Note: this code might run into trouble on days that have more then two
midnights (beginning and end).
=back
......@@ -3519,7 +3538,7 @@ There are some other functions of possible interest. Described. Here. Now.
=over 4
=item ev_once (loop, int fd, int events, ev_tstamp timeout, callback)
=item ev_once (loop, int fd, int events, ev_tstamp timeout, callback, arg)
This function combines a simple timer and an I/O watcher, calls your
callback on whichever event happens first and automatically stops both
......@@ -3961,14 +3980,14 @@ libev sources can be compiled as C++. Therefore, code that uses the C API
will work fine.
Proper exception specifications might have to be added to callbacks passed
to libev: exceptions may be thrown only from watcher callbacks, all
other callbacks (allocator, syserr, loop acquire/release and periodic
reschedule callbacks) must not throw exceptions, and might need a C<throw
()> specification. If you have code that needs to be compiled as both C
and C++ you can use the C<EV_THROW> macro for this:
to libev: exceptions may be thrown only from watcher callbacks, all other
callbacks (allocator, syserr, loop acquire/release and periodic reschedule
callbacks) must not throw exceptions, and might need a C<noexcept>
specification. If you have code that needs to be compiled as both C and
C++ you can use the C<EV_NOEXCEPT> macro for this:
static void
fatal_error (const char *msg) EV_THROW
fatal_error (const char *msg) EV_NOEXCEPT
{
perror (msg);
abort ();
......@@ -4388,11 +4407,11 @@ in your include path (e.g. in libev/ when using -Ilibev):
ev_win32.c required on win32 platforms only
ev_select.c only when select backend is enabled (which is enabled by default)
ev_poll.c only when poll backend is enabled (disabled by default)
ev_epoll.c only when the epoll backend is enabled (disabled by default)
ev_kqueue.c only when the kqueue backend is enabled (disabled by default)
ev_port.c only when the solaris port backend is enabled (disabled by default)
ev_select.c only when select backend is enabled
ev_poll.c only when poll backend is enabled
ev_epoll.c only when the epoll backend is enabled
ev_kqueue.c only when the kqueue backend is enabled
ev_port.c only when the solaris port backend is enabled
F<ev.c> includes the backend files directly when enabled, so you only need
to compile this single file.
......
......@@ -239,7 +239,7 @@ inline_size
int
epoll_init (EV_P_ int flags)
{
#ifdef EPOLL_CLOEXEC
#if defined EPOLL_CLOEXEC && !defined __ANDROID__
backend_fd = epoll_create1 (EPOLL_CLOEXEC);
if (backend_fd < 0 && (errno == EINVAL || errno == ENOSYS))
......
......@@ -195,8 +195,8 @@ VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */
VARx(void *, userdata)
/* C++ doesn't support the ev_loop_callback typedef here. stinks. */
VAR (release_cb, void (*release_cb)(EV_P) EV_THROW)
VAR (acquire_cb, void (*acquire_cb)(EV_P) EV_THROW)
VAR (release_cb, void (*release_cb)(EV_P) EV_NOEXCEPT)
VAR (acquire_cb, void (*acquire_cb)(EV_P) EV_NOEXCEPT)
VAR (invoke_cb , ev_loop_callback invoke_cb)
#endif
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment