mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
make event_base_get_running_event build with threads disabled.
This commit is contained in:
parent
55e8dc1ba2
commit
13dad99c2f
@ -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. */
|
||||
|
4
event.c
4
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user