Loading...
Searching...
No Matches
it_q.c File Reference

Osmocom Inter-Thread queue implementation. More...

`#include "../config.h"`
`#include <pthread.h>`
`#include <unistd.h>`
`#include <string.h>`
`#include <errno.h>`
`#include <sys/eventfd.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/core/talloc.h>`
`#include <osmocom/core/utils.h>`
`#include <osmocom/core/it_q.h>`

## Functions

static int | eventfd_increment (int fd, uint64_t inc)
static | LLIST_HEAD (it_queues)
static struct osmo_it_q * | _osmo_it_q_by_name (const char *name)
struct osmo_it_q * | osmo_it_q_by_name (const char *name)
| resolve it-queue by its [globally unique] name
static int | osmo_it_q_fd_cb (struct osmo_fd *ofd, unsigned int what)
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.
static void * | item_dequeue (struct llist_head *queue)
static void | _osmo_it_q_flush (struct osmo_it_q *q)
| Flush all messages currently present in queue.
void | osmo_it_q_flush (struct osmo_it_q *q)
| Flush all messages currently present in queue.
void | osmo_it_q_destroy (struct osmo_it_q *q)
| Destroy a message queue.
int | _osmo_it_q_enqueue (struct osmo_it_q *queue, struct llist_head *item)
| Thread-safe en-queue to an inter-thread message queue.
struct llist_head * | _osmo_it_q_dequeue (struct osmo_it_q *queue)
| Thread-safe de-queue from an inter-thread message queue.

## Variables

static pthread_rwlock_t | it_queues_rwlock = PTHREAD_RWLOCK_INITIALIZER

## Detailed Description

Osmocom Inter-Thread queue implementation.