From 2033988343bce413763d3e9664e3e8372da48591 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 10 Dec 2020 22:17:23 -0800 Subject: fixes #1313 support deferred nng_aio destruction --- include/nng/nng.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/nng/nng.h b/include/nng/nng.h index 20454a17..b6d37eb3 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -488,6 +488,13 @@ NNG_DECL int nng_aio_alloc(nng_aio **, void (*)(void *), void *); // It *must not* be in use at the time it is freed. NNG_DECL void nng_aio_free(nng_aio *); +// nng_aio_reap is like nng_aio_free, but calls it from a background +// reaper thread. This can be useful to free aio objects from aio +// callbacks (e.g. when the result of the callback is to discard +// the object in question.) The aio object must be in further use +// when this is called. +NNG_DECL void nng_aio_reap(nng_aio *); + // nng_aio_stop stops any outstanding operation, and waits for the // AIO to be free, including for the callback to have completed // execution. Therefore the caller must NOT hold any locks that -- cgit v1.2.3-70-g09d2