27 #ifndef EVENT_INTERNAL_H_INCLUDED_
28 #define EVENT_INTERNAL_H_INCLUDED_
34 #include "event2/event-config.h"
35 #include "evconfig-private.h"
38 #include <sys/queue.h>
40 #include "minheap-internal.h"
41 #include "evsignal-internal.h"
42 #include "mm-internal.h"
43 #include "defer-internal.h"
48 #define ev_signal_next ev_.ev_signal.ev_signal_next
49 #define ev_io_next ev_.ev_io.ev_io_next
50 #define ev_io_timeout ev_.ev_io.ev_timeout
53 #define ev_ncalls ev_.ev_signal.ev_ncalls
54 #define ev_pncalls ev_.ev_signal.ev_pncalls
56 #define ev_pri ev_evcallback.evcb_pri
57 #define ev_flags ev_evcallback.evcb_flags
58 #define ev_closure ev_evcallback.evcb_closure
59 #define ev_callback ev_evcallback.evcb_cb_union.evcb_callback
60 #define ev_arg ev_evcallback.evcb_arg
69 #define EV_CLOSURE_EVENT 0
71 #define EV_CLOSURE_EVENT_SIGNAL 1
73 #define EV_CLOSURE_EVENT_PERSIST 2
75 #define EV_CLOSURE_CB_SELF 3
77 #define EV_CLOSURE_CB_FINALIZE 4
79 #define EV_CLOSURE_EVENT_FINALIZE 5
82 #define EV_CLOSURE_EVENT_FINALIZE_FREE 6
139 #define HT_NO_CACHE_HASH_VALUES
140 #include "ht-internal.h"
141 struct event_map_entry;
142 HT_HEAD(event_io_map, event_map_entry);
144 #define event_io_map event_signal_map
165 struct event_list events;
168 struct timeval duration;
171 struct event timeout_event;
177 #define COMMON_TIMEOUT_MICROSECONDS_MASK 0x000fffff
189 #ifndef EVENT__DISABLE_DEBUG_MODE
191 extern int event_debug_mode_on_;
192 #define EVENT_DEBUG_MODE_IS_ON() (event_debug_mode_on_)
194 #define EVENT_DEBUG_MODE_IS_ON() (0)
282 struct event_io_map
io;
302 #ifndef EVENT__DISABLE_THREAD_SUPPORT
319 struct event_iocp_port *iocp;
325 struct timeval max_dispatch_time;
326 int max_dispatch_callbacks;
327 int limit_callbacks_after_prio;
354 const char *avoid_method;
363 struct timeval max_dispatch_interval;
364 int max_dispatch_callbacks;
365 int limit_callbacks_after_prio;
372 #define LIST_END(head) NULL
376 #define TAILQ_FIRST(head) ((head)->tqh_first)
379 #define TAILQ_END(head) NULL
382 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
385 #ifndef TAILQ_FOREACH
386 #define TAILQ_FOREACH(var, head, field) \
387 for ((var) = TAILQ_FIRST(head); \
388 (var) != TAILQ_END(head); \
389 (var) = TAILQ_NEXT(var, field))
392 #ifndef TAILQ_INSERT_BEFORE
393 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
394 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
395 (elm)->field.tqe_next = (listelm); \
396 *(listelm)->field.tqe_prev = (elm); \
397 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
401 #define N_ACTIVE_CALLBACKS(base) \
402 ((base)->event_count_active)
404 int evsig_set_handler_(
struct event_base *base,
int evsignal,
406 int evsig_restore_handler_(
struct event_base *base,
int evsignal);
408 int event_add_nolock_(
struct event *ev,
409 const struct timeval *tv,
int tv_is_absolute);
412 #define EVENT_DEL_NOBLOCK 0
416 #define EVENT_DEL_BLOCK 1
420 #define EVENT_DEL_AUTOBLOCK 2
423 #define EVENT_DEL_EVEN_IF_FINALIZING 3
424 int event_del_nolock_(
struct event *ev,
int blocking);
425 int event_remove_timer_nolock_(
struct event *ev);
427 void event_active_nolock_(
struct event *ev,
int res,
short count);
431 int event_callback_cancel_(
struct event_base *base,
441 void event_active_later_(
struct event *ev,
int res);
442 void event_active_later_nolock_(
struct event *ev,
int res);
443 int event_callback_activate_later_nolock_(
struct event_base *base,
445 int event_callback_cancel_nolock_(
struct event_base *base,
447 void event_callback_init_(
struct event_base *base,
452 void event_base_add_virtual_(
struct event_base *base);
453 void event_base_del_virtual_(
struct event_base *base);
462 void event_base_assert_ok_(
struct event_base *base);
463 void event_base_assert_ok_nolock_(
struct event_base *base);
474 int event_base_foreach_event_nolock_(
struct event_base *base,
482 void event_disable_debug_mode(
void);
int(* event_base_foreach_event_cb)(const struct event_base *, const struct event *, void *)
Definition: event.h:1578
event_base_config_flag
Definition: event.h:517
event_method_feature
Definition: event.h:489
Definition: event-internal.h:163
Definition: event-internal.h:208
enum event_base_config_flag flags
Definition: event-internal.h:323
LIST_HEAD(once_event_list, event_once) once_events
int n_common_timeouts_allocated
Definition: event-internal.h:279
int event_running_priority
Definition: event-internal.h:247
const struct eventop * evsigsel
Definition: event-internal.h:221
struct evsig_info sig
Definition: event-internal.h:223
struct event_callback * current_event
Definition: event-internal.h:315
int event_count_active_max
Definition: event-internal.h:236
struct event th_notify
Definition: event-internal.h:338
struct evcallback_list * activequeues
Definition: event-internal.h:264
int n_common_timeouts
Definition: event-internal.h:277
struct common_timeout_list ** common_timeout_queues
Definition: event-internal.h:275
int event_break
Definition: event-internal.h:242
unsigned long th_owner_id
Definition: event-internal.h:305
time_t last_updated_clock_diff
Definition: event-internal.h:300
struct timeval tv_clock_diff
Definition: event-internal.h:298
const struct eventop * evsel
Definition: event-internal.h:211
int virtual_event_count
Definition: event-internal.h:226
int is_notify_pending
Definition: event-internal.h:332
struct event_io_map io
Definition: event-internal.h:282
struct event_changelist changelist
Definition: event-internal.h:217
void * current_event_cond
Definition: event-internal.h:310
int event_count_active
Definition: event-internal.h:234
struct evcallback_list active_later_queue
Definition: event-internal.h:269
int nactivequeues
Definition: event-internal.h:266
evutil_socket_t th_notify_fd[2]
Definition: event-internal.h:335
int event_continue
Definition: event-internal.h:244
int running_loop
Definition: event-internal.h:251
void * evbase
Definition: event-internal.h:213
int event_count_max
Definition: event-internal.h:232
int event_gotterm
Definition: event-internal.h:240
int event_count
Definition: event-internal.h:230
struct event_signal_map sigmap
Definition: event-internal.h:285
int(* th_notify_fn)(struct event_base *base)
Definition: event-internal.h:340
struct timeval tv_cache
Definition: event-internal.h:292
struct min_heap timeheap
Definition: event-internal.h:288
int n_deferreds_queued
Definition: event-internal.h:257
void * th_base_lock
Definition: event-internal.h:307
int current_event_waiters
Definition: event-internal.h:312
struct evutil_weakrand_state weakrand_seed
Definition: event-internal.h:344
int virtual_event_count_max
Definition: event-internal.h:228
Definition: event_struct.h:107
Definition: changelist-internal.h:53
Definition: event-internal.h:183
Definition: event-internal.h:351
Definition: event-internal.h:359
Definition: event-internal.h:200
Definition: event-internal.h:151
Definition: event_struct.h:123
Definition: event-internal.h:86
enum event_method_feature features
Definition: event-internal.h:119
int(* del)(struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo)
Definition: event-internal.h:105
int(* dispatch)(struct event_base *, struct timeval *)
Definition: event-internal.h:111
int need_reinit
Definition: event-internal.h:116
size_t fdinfo_len
Definition: event-internal.h:125
void(* dealloc)(struct event_base *)
Definition: event-internal.h:113
const char * name
Definition: event-internal.h:88
int(* add)(struct event_base *, evutil_socket_t fd, short old, short events, void *fdinfo)
Definition: event-internal.h:103
Definition: evsignal-internal.h:39
Definition: time-internal.h:64
Definition: util-internal.h:315
Definition: minheap-internal.h:40
#define evutil_socket_t
Definition: util.h:310