2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

use a thread-local variable to get the current running loop

if we had a method to get the running loop, similar to how
isc_tid() gets the current thread ID, we can simplify loop
and loopmgr initialization.

remove most uses of isc_loop_current() in favor of isc_loop().
in some places where that was the only reason to pass loopmgr,
remove loopmgr from the function parameters.
This commit is contained in:
Evan Hunt
2024-03-26 00:13:45 -07:00
committed by Ondřej Surý
parent cad6292fc4
commit c47fa689d4
22 changed files with 77 additions and 79 deletions

View File

@@ -586,13 +586,13 @@ dns_view_weakdetach(dns_view_t **viewp) {
}
isc_result_t
dns_view_createresolver(dns_view_t *view, isc_loopmgr_t *loopmgr,
isc_nm_t *netmgr, unsigned int options,
isc_tlsctx_cache_t *tlsctx_cache,
dns_view_createresolver(dns_view_t *view, isc_nm_t *netmgr,
unsigned int options, isc_tlsctx_cache_t *tlsctx_cache,
dns_dispatch_t *dispatchv4,
dns_dispatch_t *dispatchv6) {
isc_result_t result;
isc_mem_t *mctx = NULL;
isc_loopmgr_t *loopmgr = isc_loop_getloopmgr(isc_loop());
REQUIRE(DNS_VIEW_VALID(view));
REQUIRE(!view->frozen);
@@ -608,7 +608,7 @@ dns_view_createresolver(dns_view_t *view, isc_loopmgr_t *loopmgr,
isc_mem_create(&mctx);
isc_mem_setname(mctx, "ADB");
dns_adb_create(mctx, view, loopmgr, &view->adb);
dns_adb_create(mctx, view, &view->adb);
isc_mem_detach(&mctx);
result = dns_requestmgr_create(view->mctx, loopmgr, view->dispatchmgr,