From 58c5fbb731f50a952864bc500a8efd3b7077ee65 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 4 Jul 2017 13:04:38 -0700 Subject: Improved routines for list management. --- src/core/aio.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/core/aio.c') diff --git a/src/core/aio.c b/src/core/aio.c index f4512a34..e1d7bdae 100644 --- a/src/core/aio.c +++ b/src/core/aio.c @@ -217,3 +217,32 @@ nni_aio_finish(nni_aio *aio, int result, size_t count) } nni_mtx_unlock(&aio->a_lk); } + + +void +nni_aio_list_init(nni_list *list) +{ + NNI_LIST_INIT(list, nni_aio, a_prov_node); +} + + +void +nni_aio_list_append(nni_list *list, nni_aio *aio) +{ + nni_aio_list_remove(aio); + nni_list_append(list, aio); +} + + +void +nni_aio_list_remove(nni_aio *aio) +{ + nni_list_node_remove(&aio->a_prov_node); +} + + +int +nni_aio_list_active(nni_aio *aio) +{ + return (nni_list_node_active(&aio->a_prov_node)); +} -- cgit v1.2.3-70-g09d2