make event_base_get_running_event build with threads disabled.

This commit is contained in:
Nick Mathewson 2012-04-03 14:53:00 -04:00
parent 55e8dc1ba2
commit 13dad99c2f
2 changed files with 4 additions and 4 deletions

View File

@ -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. */

View File

@ -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);