Kannel: Open Source WAP and SMS gateway
svn-r5336
|
Go to the source code of this file.
Macros | |
#define | gw_prioqueue_produce(queue, item) gw_prioqueue_insert(queue, item) |
Typedefs | |
typedef struct gw_prioqueue | gw_prioqueue_t |
Functions | |
gw_prioqueue_t * | gw_prioqueue_create (int(*cmp)(const void *, const void *)) |
void | gw_prioqueue_destroy (gw_prioqueue_t *queue, void(*item_destroy)(void *)) |
long | gw_prioqueue_len (gw_prioqueue_t *queue) |
void | gw_prioqueue_insert (gw_prioqueue_t *queue, void *item) |
void | gw_prioqueue_foreach (gw_prioqueue_t *queue, void(*fn)(const void *, long)) |
void * | gw_prioqueue_remove (gw_prioqueue_t *queue) |
void * | gw_prioqueue_get (gw_prioqueue_t *queue) |
void * | gw_prioqueue_consume (gw_prioqueue_t *queue) |
void | gw_prioqueue_add_producer (gw_prioqueue_t *queue) |
void | gw_prioqueue_remove_producer (gw_prioqueue_t *queue) |
long | gw_prioqueue_producer_count (gw_prioqueue_t *queue) |
#define gw_prioqueue_produce | ( | queue, | |
item | |||
) | gw_prioqueue_insert(queue, item) |
Definition at line 98 of file gw-prioqueue.h.
Referenced by add_msg_cb(), at2_add_msg_cb(), clear_sent(), emi2_idleprocessing(), and send_msg_cb().
typedef struct gw_prioqueue gw_prioqueue_t |
Definition at line 68 of file gw-prioqueue.h.
void gw_prioqueue_add_producer | ( | gw_prioqueue_t * | queue | ) |
Add producer to the priority queue - priority queue
Definition at line 331 of file gw-prioqueue.c.
References gw_assert(), queue, queue_lock(), and queue_unlock().
Referenced by smpp_create().
void* gw_prioqueue_consume | ( | gw_prioqueue_t * | queue | ) |
Remove biggest item from the priority queue, but block if producers available and none items in the queue - priority queue
Definition at line 303 of file gw-prioqueue.c.
References downheap(), gw_assert(), gwthread_self(), List::len, List::nonempty, queue, queue_lock(), queue_unlock(), and List::tab.
gw_prioqueue_t* gw_prioqueue_create | ( | int(*)(const void *, const void *) | cmp | ) |
Create priority queue - compare function
Definition at line 174 of file gw-prioqueue.c.
References gw_prioqueue::cmp, gw_assert(), element::item, gw_prioqueue::len, make_bigger(), gw_prioqueue::mutex, mutex_create, gw_prioqueue::nonempty, gw_prioqueue::producers, element::seq, gw_prioqueue::seq, gw_prioqueue::size, and gw_prioqueue::tab.
Referenced by main(), smpp_create(), smsc_at2_create(), and smsc_emi2_create().
void gw_prioqueue_destroy | ( | gw_prioqueue_t * | queue, |
void(*)(void *) | item_destroy | ||
) |
Destroy priority queue - queue to destroy - item destructor
Definition at line 201 of file gw-prioqueue.c.
References item_destroy(), List::len, mutex_destroy(), List::nonempty, queue, and List::tab.
Referenced by at2_device_thread(), emi2_sender(), smpp_destroy(), smsc_at2_create(), and smsc_emi2_create().
void gw_prioqueue_foreach | ( | gw_prioqueue_t * | queue, |
void(*)(const void *, long) | fn | ||
) |
Definition at line 252 of file gw-prioqueue.c.
References gw_assert(), List::len, queue, queue_lock(), queue_unlock(), and List::tab.
Referenced by main().
void* gw_prioqueue_get | ( | gw_prioqueue_t * | queue | ) |
Definition at line 286 of file gw-prioqueue.c.
References gw_assert(), List::len, queue, queue_lock(), queue_unlock(), and List::tab.
void gw_prioqueue_insert | ( | gw_prioqueue_t * | queue, |
void * | item | ||
) |
Insert item into the priority queue - priority queue - to be inserted item
Definition at line 235 of file gw-prioqueue.c.
References gw_assert(), element::item, List::len, make_bigger(), List::nonempty, queue, queue_lock(), queue_unlock(), List::tab, and upheap().
Referenced by main().
long gw_prioqueue_len | ( | gw_prioqueue_t * | queue | ) |
Return priority queue length - priority queue
Definition at line 220 of file gw-prioqueue.c.
References List::len, queue, queue_lock(), and queue_unlock().
Referenced by at2_device_thread(), at2_queued_cb(), at2_send_messages(), emi2_wait(), io_thread(), main(), and queued_cb().
long gw_prioqueue_producer_count | ( | gw_prioqueue_t * | queue | ) |
Return producer count for the priority queue - priority queue
Definition at line 353 of file gw-prioqueue.c.
References gw_assert(), queue, queue_lock(), and queue_unlock().
void* gw_prioqueue_remove | ( | gw_prioqueue_t * | queue | ) |
Remove biggest item from the priority queue, but not block if producers available and none items in the queue - priority queue
Definition at line 265 of file gw-prioqueue.c.
References downheap(), gw_assert(), List::len, queue, queue_lock(), queue_unlock(), and List::tab.
Referenced by at2_send_messages(), at2_shutdown_cb(), emi2_do_send(), emi2_sender(), io_thread(), main(), open_send_connection(), send_messages(), and shutdown_cb().
void gw_prioqueue_remove_producer | ( | gw_prioqueue_t * | queue | ) |
Remove producer from the priority queue - priority queue
Definition at line 341 of file gw-prioqueue.c.
References gw_assert(), List::nonempty, queue, queue_lock(), and queue_unlock().