AC_INIT(event.c)
AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_AUX_DIR([build-aux])
- AM_INIT_AUTOMAKE(libevent,2.1.0-alpha-dev)
+ AM_INIT_AUTOMAKE(libevent,2.1.1-alpha-dev)
dnl AM_SILENT_RULES req. automake 1.11. [no] defaults V=1
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_CONFIG_HEADER(config.h evconfig-private.h:evconfig-private.h.in)
- AC_DEFINE(NUMERIC_VERSION, 0x02010001, [Numeric representation of the version])
+ AC_DEFINE(NUMERIC_VERSION, 0x02010101, [Numeric representation of the version])
dnl Initialize prefix.
if test "$prefix" = "NONE"; then
{
base->tv_cache.tv_sec = 0;
if (!(base->flags & EVENT_BASE_FLAG_NO_CACHE_TIME))
- gettime(base, &base->tv_cache);
+ gettime(base, &base->tv_cache);
}
+ int
+ event_base_update_cache_time(struct event_base *base)
+ {
+
+ if (!base) {
+ base = current_base;
+ if (!current_base)
+ return -1;
+ }
+
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
+ update_time_cache(base);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
+ return 0;
+ }
+
struct event_base *
event_init(void)
{
#include <sys/queue.h>
- #ifdef _EVENT_HAVE_NETINET_IN_H
+ #ifdef EVENT__HAVE_NETINET_IN_H
#include <netinet/in.h>
+# ifdef _XOPEN_SOURCE_EXTENDED
+# include <arpa/inet.h>
+# endif
#endif
- #ifdef _EVENT_HAVE_ARPA_INET_H
+ #ifdef EVENT__HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
- #ifdef _EVENT_HAVE_NETDB_H
+ #ifdef EVENT__HAVE_NETDB_H
#include <netdb.h>
#endif
#define EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
#endif
+ /**
+ Writes a human-readable description of all inserted and/or active
+ events to a provided stdio stream.
+
+ This is intended for debugging; its format is not guaranteed to be the same
+ between libevent versions.
+
+ @param base An event_base on which to scan the events.
+ @param output A stdio file to write on.
+ */
void event_base_dump_events(struct event_base *, FILE *);
-/** Sets 'tv' to the current time (as returned by gettimeofday()),
+/** Sets 'tv' to the internal time (used for timeout scheduling),
looking at the cached value in 'base' if possible, and calling
gettimeofday() or clock_gettime() as appropriate if there is no
- cached time.
+ cached time. If clock_gettime(CLOCK_MONOTONIC) is being used
+ internally, the tv_sec of internal times represent system uptime
+ rather than time since UNIX epoch.
+
+ Generally, this value will only be cached while actually
+ processing event callbacks, and may be very inaccurate if your
+ callbacks take a long time to execute.
+
+ Returns 0 on success, negative on failure.
+ */
+int event_base_tv_cached(struct event_base *base,
+ struct timeval *tv);
+
+/** Sets 'tv' to the current time (as returned by gettimeofday()),
+ looking at the cached value in 'base' if possible, and calling
+ gettimeofday() if there is no cached time.
Generally, this value will only be cached while actually
- processing event callbacks, and may be very inaccuate if your
+ processing event callbacks, and may be very inaccurate if your
callbacks take a long time to execute.
Returns 0 on success, negative on failure.