Libevent Code Doxygen document
Public Member Functions | Public Attributes | List of all members
event_base Struct Reference
Collaboration diagram for event_base:
Collaboration graph
[legend]

Public Member Functions

 LIST_HEAD (once_event_list, event_once) once_events
 

Public Attributes

const struct eventopevsel
 
void * evbase
 
struct event_changelist changelist
 
const struct eventopevsigsel
 
struct evsig_info sig
 
int virtual_event_count
 
int virtual_event_count_max
 
int event_count
 
int event_count_max
 
int event_count_active
 
int event_count_active_max
 
int event_gotterm
 
int event_break
 
int event_continue
 
int event_running_priority
 
int running_loop
 
int n_deferreds_queued
 
struct evcallback_list * activequeues
 
int nactivequeues
 
struct evcallback_list active_later_queue
 
struct common_timeout_list ** common_timeout_queues
 
int n_common_timeouts
 
int n_common_timeouts_allocated
 
struct event_io_map io
 
struct event_signal_map sigmap
 
struct min_heap timeheap
 
struct timeval tv_cache
 
struct evutil_monotonic_timer monotonic_timer
 
struct timeval tv_clock_diff
 
time_t last_updated_clock_diff
 
unsigned long th_owner_id
 
void * th_base_lock
 
void * current_event_cond
 
int current_event_waiters
 
struct event_callbackcurrent_event
 
enum event_base_config_flag flags
 
struct timeval max_dispatch_time
 
int max_dispatch_callbacks
 
int limit_callbacks_after_prio
 
int is_notify_pending
 
evutil_socket_t th_notify_fd [2]
 
struct event th_notify
 
int(* th_notify_fn )(struct event_base *base)
 
struct evutil_weakrand_state weakrand_seed
 

Member Function Documentation

◆ LIST_HEAD()

event_base::LIST_HEAD ( once_event_list  ,
event_once   
)

List of event_onces that have not yet fired.

Member Data Documentation

◆ active_later_queue

struct evcallback_list event_base::active_later_queue

A list of event_callbacks that should become active the next time we process events, but not this time.

◆ activequeues

struct evcallback_list* event_base::activequeues

An array of nactivequeues queues for active event_callbacks (ones that have triggered, and whose callbacks need to be called). Low priority numbers are more important, and stall higher ones.

◆ changelist

struct event_changelist event_base::changelist

List of changes to tell backend about at next dispatch. Only used by the O(1) backends.

◆ common_timeout_queues

struct common_timeout_list** event_base::common_timeout_queues

An array of common_timeout_list* for all of the common timeout values we know.

◆ current_event

struct event_callback* event_base::current_event

The event whose callback is executing right now

◆ current_event_cond

void* event_base::current_event_cond

A condition that gets signalled when we're done processing an event with waiters on it.

◆ current_event_waiters

int event_base::current_event_waiters

Number of threads blocking on current_event_cond.

◆ evbase

void* event_base::evbase

Pointer to backend-specific data.

◆ event_break

int event_base::event_break

Set if we should terminate the loop immediately

◆ event_continue

int event_base::event_continue

Set if we should start a new instance of the loop immediately.

◆ event_count

int event_base::event_count

Number of total events added to this event_base

◆ event_count_active

int event_base::event_count_active

Number of total events active in this event_base

◆ event_count_active_max

int event_base::event_count_active_max

Maximum number of total events active in this event_base

◆ event_count_max

int event_base::event_count_max

Maximum number of total events added to this event_base

◆ event_gotterm

int event_base::event_gotterm

Set if we should terminate the loop once we're done processing events.

◆ event_running_priority

int event_base::event_running_priority

The currently running priority of events

◆ evsel

const struct eventop* event_base::evsel

Function pointers and other data to describe this event_base's backend.

◆ evsigsel

const struct eventop* event_base::evsigsel

Function pointers used to describe the backend that this event_base uses for signals

◆ flags

enum event_base_config_flag event_base::flags

Flags that this base was configured with

◆ io

struct event_io_map event_base::io

Mapping from file descriptors to enabled (added) events

◆ is_notify_pending

int event_base::is_notify_pending

True if the base already has a pending notify, and we don't need to add any more.

◆ last_updated_clock_diff

time_t event_base::last_updated_clock_diff

Second in which we last updated tv_clock_diff, in monotonic time.

◆ n_common_timeouts

int event_base::n_common_timeouts

The number of entries used in common_timeout_queues

◆ n_common_timeouts_allocated

int event_base::n_common_timeouts_allocated

The total size of common_timeout_queues.

◆ n_deferreds_queued

int event_base::n_deferreds_queued

Set to the number of deferred_cbs we've made 'active' in the loop. This is a hack to prevent starvation; it would be smarter to just use event_config_set_max_dispatch_interval's max_callbacks feature

◆ nactivequeues

int event_base::nactivequeues

The length of the activequeues array

◆ running_loop

int event_base::running_loop

Set if we're running the event_base_loop function, to prevent reentrant invocation.

◆ sig

struct evsig_info event_base::sig

Data to implement the common signal handler code.

◆ sigmap

struct event_signal_map event_base::sigmap

Mapping from signal numbers to enabled (added) events.

◆ th_base_lock

void* event_base::th_base_lock

A lock to prevent conflicting accesses to this event_base

◆ th_notify

struct event event_base::th_notify

An event used by some th_notify functions to wake up the main thread.

◆ th_notify_fd

evutil_socket_t event_base::th_notify_fd[2]

A socketpair used by some th_notify functions to wake up the main thread.

◆ th_notify_fn

int(* event_base::th_notify_fn) (struct event_base *base)

A function used to wake up the main thread from another thread.

◆ th_owner_id

unsigned long event_base::th_owner_id

The thread currently running the event_loop for this base

◆ timeheap

struct min_heap event_base::timeheap

Priority queue of events with timeouts.

◆ tv_cache

struct timeval event_base::tv_cache

Stored timeval: used to avoid calling gettimeofday/clock_gettime too often.

◆ tv_clock_diff

struct timeval event_base::tv_clock_diff

Difference between internal time (maybe from clock_gettime) and gettimeofday.

◆ virtual_event_count

int event_base::virtual_event_count

Number of virtual events

◆ virtual_event_count_max

int event_base::virtual_event_count_max

Maximum number of virtual events active

◆ weakrand_seed

struct evutil_weakrand_state event_base::weakrand_seed

Saved seed for weak random number generator. Some backends use this to produce fairness among sockets. Protected by th_base_lock.


The documentation for this struct was generated from the following file: