From 5febb7e0020e29a0f4c122fc85a42e603437d511 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Sun, 3 Nov 2019 20:58:37 -0800 Subject: [PATCH] fixup! - Always close listening sockets asynchronously, even if we're in the specific thread - Export some lib/ns/client stuff for unit tests - Fix lib/ns unit tests --- lib/ns/tests/nstest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ns/tests/nstest.c b/lib/ns/tests/nstest.c index 9778b4b93c..1d0354ff19 100644 --- a/lib/ns/tests/nstest.c +++ b/lib/ns/tests/nstest.c @@ -87,7 +87,7 @@ __wrap_isc_nmhandle_unref(isc_nmhandle_t *handle) { int i; for (i = 0; i < 16; i++) { - if (client_addrs[i] == (uintptr_t) client) { + if (atomic_load(&client_addrs[i]) == (uintptr_t) client) { break; } } @@ -562,8 +562,8 @@ ns_test_getclient(ns_interface_t *ifp0, bool tcp, result = ns__client_setup(client, clientmgr, true); for (i = 0; i < 16; i++) { - if (client_addrs[i] == (uintptr_t) NULL || - client_addrs[i] == (uintptr_t) client) + if (atomic_load(&client_addrs[i]) == (uintptr_t) NULL || + atomic_load(&client_addrs[i]) == (uintptr_t) client) { break; }