From 980386152f6fc6db93baa56206ea0ba280ecdcf2 Mon Sep 17 00:00:00 2001 From: oxmox Date: Sat, 4 Feb 2023 00:00:14 +0100 Subject: [PATCH] nng: make nng_set_resolve_thread_max() apply on posix Note: things will break if nng_set_resolve_thread_max() is modified at runtime and more resolver are spawned. Not sure if this can actually happen. --- external/nng/src/platform/posix/posix_resolv_gai.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external/nng/src/platform/posix/posix_resolv_gai.c b/external/nng/src/platform/posix/posix_resolv_gai.c index 8e1878b..f1f917e 100644 --- a/external/nng/src/platform/posix/posix_resolv_gai.c +++ b/external/nng/src/platform/posix/posix_resolv_gai.c @@ -457,14 +457,14 @@ nni_posix_resolv_sysinit(void) resolv_fini = false; - for (int i = 0; i < NNG_RESOLV_CONCURRENCY; i++) { + for (int i = 0; i < nng_resolv_concurrency; i++) { int rv = nni_thr_init(&resolv_thrs[i], resolv_worker, NULL); if (rv != 0) { nni_posix_resolv_sysfini(); return (rv); } } - for (int i = 0; i < NNG_RESOLV_CONCURRENCY; i++) { + for (int i = 0; i < nng_resolv_concurrency; i++) { nni_thr_run(&resolv_thrs[i]); } @@ -479,7 +479,7 @@ nni_posix_resolv_sysfini(void) nni_cv_wake(&resolv_cv); nni_mtx_unlock(&resolv_mtx); - for (int i = 0; i < NNG_RESOLV_CONCURRENCY; i++) { + for (int i = 0; i < nng_resolv_concurrency; i++) { nni_thr_fini(&resolv_thrs[i]); } nni_cv_fini(&resolv_cv);