aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/gapk/procqueue.h5
-rw-r--r--src/app_osmo_gapk.c2
-rw-r--r--src/procqueue.c9
3 files changed, 13 insertions, 3 deletions
diff --git a/include/osmocom/gapk/procqueue.h b/include/osmocom/gapk/procqueue.h
index 9b049a5..dfd0db1 100644
--- a/include/osmocom/gapk/procqueue.h
+++ b/include/osmocom/gapk/procqueue.h
@@ -52,10 +52,13 @@ struct osmo_gapk_pq_item {
struct osmo_gapk_pq {
struct llist_head items;
unsigned n_items;
+
+ /*! \brief human-readable name */
+ const char *name;
};
/* Processing queue management */
-struct osmo_gapk_pq *osmo_gapk_pq_create(void);
+struct osmo_gapk_pq *osmo_gapk_pq_create(const char *name);
int osmo_gapk_pq_prepare(struct osmo_gapk_pq *pq);
int osmo_gapk_pq_execute(struct osmo_gapk_pq *pq);
void osmo_gapk_pq_destroy(struct osmo_gapk_pq *pq);
diff --git a/src/app_osmo_gapk.c b/src/app_osmo_gapk.c
index 2ce0a31..6543eef 100644
--- a/src/app_osmo_gapk.c
+++ b/src/app_osmo_gapk.c
@@ -734,7 +734,7 @@ int main(int argc, char *argv[])
return rv;
/* Create processing queue */
- gs->pq = osmo_gapk_pq_create();
+ gs->pq = osmo_gapk_pq_create("main");
if (!gs->pq) {
rv = -ENOMEM;
LOGP(DAPP, LOGL_ERROR, "Error creating processing queue\n");
diff --git a/src/procqueue.c b/src/procqueue.c
index 3303cce..2c7b7fc 100644
--- a/src/procqueue.c
+++ b/src/procqueue.c
@@ -32,7 +32,7 @@ extern TALLOC_CTX *gapk_root_ctx;
/* crate a new (empty) processing queue */
struct osmo_gapk_pq *
-osmo_gapk_pq_create(void)
+osmo_gapk_pq_create(const char *name)
{
struct osmo_gapk_pq *pq;
@@ -41,6 +41,13 @@ osmo_gapk_pq_create(void)
if (!pq)
return NULL;
+ if (name != NULL) {
+ /* Rename talloc context */
+ talloc_set_name(pq, "struct osmo_gapk_pq '%s'", name);
+ /* Set queue name */
+ pq->name = name;
+ }
+
/* Init its list of items */
INIT_LLIST_HEAD(&pq->items);