Add isc_async_current() macro to run job on current loop

Previously, isc_job_run() could have been used to run the job on the
current loop and the isc_job_run() would take care of allocating and
deallocating the job.  After the change in this MR, the isc_job_run()
is more complicated to use, so we introduce the isc_async_current()
macro to suplement isc_async_run() when we need to run the job on the
current loop.
This commit is contained in:
Ondřej Surý
2023-03-29 09:02:22 +02:00
parent 1844590ad9
commit f5fc224af3
9 changed files with 22 additions and 25 deletions

View File

@@ -45,4 +45,10 @@ isc_async_run(isc_loop_t *loop, isc_job_cb cb, void *cbarg);
*\li 'cbarg' is passed to the 'cb' as the only argument, may be NULL
*/
#define isc_async_current(loopmgr, cb, cbarg) \
isc_async_run(isc_loop_current(loopmgr), cb, cbarg)
/*%<
* Helper macro to run the job on the current loop
*/
ISC_LANG_ENDDECLS