From 13dad99c2fa0ca94d1ac5398cf8f2951d9b8840c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 3 Apr 2012 14:53:00 -0400 Subject: [PATCH] make event_base_get_running_event build with threads disabled. --- event-internal.h | 4 ++-- event.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/event-internal.h b/event-internal.h index 1a64ed42..f840058d 100644 --- a/event-internal.h +++ b/event-internal.h @@ -257,14 +257,14 @@ struct event_base { unsigned long th_owner_id; /** A lock to prevent conflicting accesses to this event_base */ void *th_base_lock; - /** The event whose callback is executing right now */ - struct event *current_event; /** A condition that gets signalled when we're done processing an * event with waiters on it. */ void *current_event_cond; /** Number of threads blocking on current_event_cond. */ int current_event_waiters; #endif + /** The event whose callback is executing right now */ + struct event *current_event; #ifdef _WIN32 /** IOCP support structure, if IOCP is enabled. */ diff --git a/event.c b/event.c index 3cf96ad0..14950238 100644 --- a/event.c +++ b/event.c @@ -1428,8 +1428,8 @@ event_process_active_single_queue(struct event_base *base, ev->ev_res & EV_WRITE ? "EV_WRITE " : " ", ev->ev_callback)); -#ifndef EVENT__DISABLE_THREAD_SUPPORT base->current_event = ev; +#ifndef EVENT__DISABLE_THREAD_SUPPORT base->current_event_waiters = 0; #endif @@ -1449,8 +1449,8 @@ event_process_active_single_queue(struct event_base *base, } EVBASE_ACQUIRE_LOCK(base, th_base_lock); -#ifndef EVENT__DISABLE_THREAD_SUPPORT base->current_event = NULL; +#ifndef EVENT__DISABLE_THREAD_SUPPORT if (base->current_event_waiters) { base->current_event_waiters = 0; EVTHREAD_COND_BROADCAST(base->current_event_cond);