*/
void event_deferred_cb_schedule(struct deferred_cb_queue *, struct deferred_cb *);
+#ifdef _EVENT_DISABLE_THREAD_SUPPORT
+#define LOCK_DEFERRED_QUEUE(q) (void)0
+#define UNLOCK_DEFERRED_QUEUE(q) (void)0
+#else
#define LOCK_DEFERRED_QUEUE(q) \
do { \
if ((q)->lock) \
_evthread_locking_fn(EVTHREAD_UNLOCK|EVTHREAD_WRITE, \
(q)->lock); \
} while (0)
+#endif
#ifdef __cplusplus
}
static void
evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg) {
struct evdns_request *const req = (struct evdns_request *) arg;
+#ifndef _EVENT_DISABLE_THREAD_SUPPORT
struct evdns_base *base = req->base;
+#endif
(void) fd;
(void) events;
base->th_notify_fd[0] = -1;
base->th_notify_fd[1] = -1;
+#ifndef _EVENT_DISABLE_THREAD_SUPPORT
if (!cfg || !(cfg->flags & EVENT_BASE_FLAG_NOLOCK)) {
int r;
EVTHREAD_ALLOC_LOCK(base->th_base_lock);
return NULL;
}
}
+#endif
#ifdef WIN32
if (cfg && (cfg->flags & EVENT_BASE_FLAG_STARTUP_IOCP))
nfds = pop->nfds;
+#ifndef _EVENT_DISABLE_THREAD_SUPPORT
if (base->th_base_lock) {
/* If we're using this backend in a multithreaded setting,
* then we need to work on a copy of event_set, so that we can
} else {
event_set = pop->event_set;
}
+#else
+ event_set = pop->event_set;
+#endif
if (tv != NULL)
msec = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000;