dnl Dug Song <dugsong@monkey.org>
AC_INIT(event.c)
-AM_INIT_AUTOMAKE(libevent,1.0)
+AM_INIT_AUTOMAKE(libevent,1.0b)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
int event_count; /* counts number of total events */
int event_count_active; /* counts number of active events */
- /* Handle signals - This is a deprecated interface */
- int (*event_sigcb)(void); /* Signal callback when gotsig is set */
- int event_gotsig; /* Set in signal handler */
int event_gotterm; /* Set to terminate loop */
/* active event management */
struct event_base *current_base = NULL;
+/* Handle signals - This is a deprecated interface */
+int (*event_sigcb)(void); /* Signal callback when gotsig is set */
+int event_gotsig; /* Set in signal handler */
+
/* Prototypes */
static void event_queue_insert(struct event_base *, struct event *, int);
static void event_queue_remove(struct event_base *, struct event *, int);
if ((current_base = calloc(1, sizeof(struct event_base))) == NULL)
err(1, "%s: calloc");
- current_base->event_sigcb = NULL;
- current_base->event_gotsig = 0;
+ event_sigcb = NULL;
+ event_gotsig = 0;
gettimeofday(¤t_base->event_tv, NULL);
#if defined(USE_LOG) && defined(USE_DEBUG)
break;
}
- while (base->event_gotsig) {
- base->event_gotsig = 0;
- if (base->event_sigcb) {
- res = (*base->event_sigcb)();
+ /* You cannot use this interface for multi-threaded apps */
+ while (event_gotsig) {
+ event_gotsig = 0;
+ if (event_sigcb) {
+ res = (*event_sigcb)();
if (res == -1) {
errno = EINTR;
return (-1);
/* An event without a base has not been added */
if (ev->ev_base == NULL)
- return;
+ return (-1);
base = ev->ev_base;
evsel = base->evsel;