Mon Oct 8 12:39:32 2012

Asterisk developer's documentation


eventqent Struct Reference
[AMI functions]


Data Fields

int category
struct {
   eventqent *   next
eq_next
char eventdata [1]
unsigned int seq
timeval tv
int usecount

Detailed Description

Linked list of events. Global events are appended to the list by append_event(). The usecount is the number of stored pointers to the element, excluding the list pointers. So an element that is only in the list has a usecount of 0, not 1.

Clients have a pointer to the last event processed, and for each of these clients we track the usecount of the elements. If we have a pointer to an entry in the list, it is safe to navigate it forward because elements will not be deleted, but only appended. The worst that can happen is seeing the pointer still NULL.

When the usecount of an element drops to 0, and the element is the first in the list, we can remove it. Removal is done within the main thread, which is woken up for the purpose.

For simplicity of implementation, we make sure the list is never empty.

Definition at line 868 of file manager.c.


Field Documentation

int category

Definition at line 870 of file manager.c.

Referenced by handle_showmaneventq(), and process_events().

struct { ... } eq_next

Referenced by advance_event(), handle_showmaneventq(), and purge_events().

char eventdata[1]

really variable size, allocated by append_event()

Definition at line 874 of file manager.c.

Referenced by handle_showmaneventq(), and process_events().

struct eventqent* next

Definition at line 873 of file manager.c.

Referenced by advance_event(), and ast_instring().

unsigned int seq

sequence number

Definition at line 871 of file manager.c.

struct timeval tv

When event was allocated

Definition at line 872 of file manager.c.

Referenced by purge_events().

int usecount

# of clients who still need the event

Definition at line 869 of file manager.c.

Referenced by advance_event(), grab_last(), handle_showmaneventq(), purge_events(), and session_destructor().


The documentation for this struct was generated from the following file:
Generated on Mon Oct 8 12:39:32 2012 for Asterisk - The Open Source Telephony Project by  doxygen 1.4.7