*/
int (*disable)(struct bufferevent *, short);
- /** DOCUMENT */
+ /** Detatches the bufferevent from related data structures. Called as
+ * soon as its reference count reaches 0. */
void (*unlink)(struct bufferevent *);
/** Free any storage and deallocate any extra data or structures used
- in this implementation. DOCUMENT
+ in this implementation. Called when the bufferevent is
+ finalized.
*/
void (*destruct)(struct bufferevent *);
#define ev_callback ev_evcallback.evcb_cb_union.evcb_callback
#define ev_arg ev_evcallback.evcb_arg
-/* Possible values for evcb_closure in struct event_callback */
-/* DOCUMENT these. */
+/** @name Event closure codes
+
+ Possible values for evcb_closure in struct event_callback
+
+ @{
+ */
+/** A regular event. Uses the evcb_callback callback */
#define EV_CLOSURE_EVENT 0
+/** A signal event. Uses the evcb_callback callback */
#define EV_CLOSURE_EVENT_SIGNAL 1
+/** A persistent non-signal event. Uses the evcb_callback callback */
#define EV_CLOSURE_EVENT_PERSIST 2
+/** A simple callback. Uses the evcb_selfcb callback. */
#define EV_CLOSURE_CB_SELF 3
+/** A finalizing callback. Uses the evcb_cbfinalize callback. */
#define EV_CLOSURE_CB_FINALIZE 4
+/** A finalizing event. Uses the evcb_evfinalize callback. */
#define EV_CLOSURE_EVENT_FINALIZE 5
+/** A finalizing event that should get freed after. Uses the evcb_evfinalize
+ * callback. */
#define EV_CLOSURE_EVENT_FINALIZE_FREE 6
+/** @} */
/** Structure to define the backend of a given event_base. */
struct eventop {
int event_add_nolock_(struct event *ev,
const struct timeval *tv, int tv_is_absolute);
+/** Argument for event_del_nolock_. Tells event_del not to block on the event
+ * if it's running in another thread. */
#define EVENT_DEL_NOBLOCK 0
+/** Argument for event_del_nolock_. Tells event_del to block on the event
+ * if it's running in another thread, regardless of its value for EV_FINALIZE
+ */
#define EVENT_DEL_BLOCK 1
+/** Argument for event_del_nolock_. Tells event_del to block on the event
+ * if it is running in another thread and it doesn't have EV_FINALIZE set.
+ */
#define EVENT_DEL_AUTOBLOCK 2
+/** Argument for event_del_nolock_. Tells event_del to procede even if the
+ * event is set up for finalization rather for regular use.*/
#define EVENT_DEL_EVEN_IF_FINALIZING 3
int event_del_nolock_(struct event *ev, int blocking);
int event_remove_timer_nolock_(struct event *ev);
return event_del_(ev, EVENT_DEL_NOBLOCK);
}
-/* Helper for event_del: always called with th_base_lock held.
- * DOCUMENT blocking */
+/** Helper for event_del: always called with th_base_lock held.
+ *
+ * "blocking" must be one of the EVENT_DEL_{BLOCK, NOBLOCK, AUTOBLOCK,
+ * EVEN_IF_FINALIZING} values. See those for more information.
+ */
int
event_del_nolock_(struct event *ev, int blocking)
{
Note that this function will not close any fds or free any memory passed
to event_new as the argument to callback.
+ If there are any pending finalizer callbacks, this function will invoke
+ them.
@param eb an event_base to be freed
*/
void event_base_free(struct event_base *);
-/** DOCUMENT */
+/**
+ As event_free, but do not run finalizers.
+ */
void event_base_free_nofinalize(struct event_base *);
/** @name Log severities
The event_free_finalize() function frees the event after it's finalized;
event_finalize() does not.
+
+ A finalizer callback must not make events pending or active. It must not
+ add events, activate events, or attempt to "resucitate" the event being
+ finalized in any way.
*/
/**@{*/
void event_finalize(unsigned, struct event *, event_finalize_callback_fn);