|
libosmocore 1.7.0
Osmocom core library
|
Data Structures | |
| struct | osmo_it_q |
| One instance of an inter-thread queue. More... | |
Macros | |
| #define | osmo_it_q_enqueue(queue, item, member) _osmo_it_q_enqueue(queue, &(item)->member) |
| #define | osmo_it_q_dequeue(queue, item, member) |
Functions | |
| struct osmo_it_q * | osmo_it_q_by_name (const char *name) |
| resolve it-queue by its [globally unique] name More... | |
| int | _osmo_it_q_enqueue (struct osmo_it_q *queue, struct llist_head *item) |
| Thread-safe en-queue to an inter-thread message queue. More... | |
| struct llist_head * | _osmo_it_q_dequeue (struct osmo_it_q *queue) |
| Thread-safe de-queue from an inter-thread message queue. More... | |
| struct osmo_it_q * | osmo_it_q_alloc (void *ctx, const char *name, unsigned int max_length, void(*read_cb)(struct osmo_it_q *q, struct llist_head *item), void *data) |
| Allocate a new inter-thread message queue. More... | |
| void | osmo_it_q_destroy (struct osmo_it_q *q) |
| Destroy a message queue. More... | |
| void | osmo_it_q_flush (struct osmo_it_q *q) |
| Flush all messages currently present in queue. More... | |
| #define osmo_it_q_dequeue | ( | queue, | |
| item, | |||
| member | |||
| ) |
| #define osmo_it_q_enqueue | ( | queue, | |
| item, | |||
| member | |||
| ) | _osmo_it_q_enqueue(queue, &(item)->member) |
| struct llist_head * _osmo_it_q_dequeue | ( | struct osmo_it_q * | queue | ) |
Thread-safe de-queue from an inter-thread message queue.
| [in] | queue | Inter-thread queue from which to dequeue |
References current_length, l, list, llist_del(), llist_empty(), mutex, llist_head::next, and OSMO_ASSERT.
Referenced by osmo_it_q_fd_cb().
| int _osmo_it_q_enqueue | ( | struct osmo_it_q * | queue, |
| struct llist_head * | item | ||
| ) |
Thread-safe en-queue to an inter-thread message queue.
| [in] | queue | Inter-thread queue on which to enqueue |
| [in] | item | Item to enqueue. Must have llist_head as first member! |
References current_length, event_ofd, eventfd_increment(), osmo_fd::fd, list, llist_add_tail(), max_length, mutex, and OSMO_ASSERT.
| struct osmo_it_q * osmo_it_q_alloc | ( | void * | ctx, |
| const char * | name, | ||
| unsigned int | max_length, | ||
| void(*)(struct osmo_it_q *q, struct llist_head *item) | read_cb, | ||
| void * | data | ||
| ) |
Allocate a new inter-thread message queue.
| [in] | ctx | talloc context from which to allocate the queue |
| [in] | name | human-readable string name of the queue; function creates a copy. |
| [in] | read_cb | call-back function to be called for each de-queued message; may be NULL in case you don't want eventfd/osmo_select integration and will manually take care of noticing if and when to dequeue. |
References _osmo_it_q_by_name(), current_length, data, data, entry, event_ofd, osmo_fd::fd, INIT_LLIST_HEAD, it_queues_rwlock, list, llist_add_tail(), max_length, mutex, name, name, osmo_fd_close(), OSMO_FD_READ, osmo_fd_setup(), osmo_it_q_fd_cb(), and read_cb.
| struct osmo_it_q * osmo_it_q_by_name | ( | const char * | name | ) |
resolve it-queue by its [globally unique] name
References _osmo_it_q_by_name(), it_queues_rwlock, and name.
| void osmo_it_q_destroy | ( | struct osmo_it_q * | q | ) |
Destroy a message queue.
References entry, event_ofd, osmo_fd::fd, it_queues_rwlock, llist_del(), mutex, OSMO_ASSERT, osmo_fd_close(), and osmo_it_q_flush().
| void osmo_it_q_flush | ( | struct osmo_it_q * | q | ) |
Flush all messages currently present in queue.
References _osmo_it_q_flush(), mutex, and OSMO_ASSERT.
Referenced by osmo_it_q_destroy().