From: Otto Moerbeek Date: Tue, 28 Apr 2020 11:32:51 +0000 (+0200) Subject: Avoid "pthread_rwlock_destroy on rwlock with waiters!" on OpenBSD X-Git-Tag: dnsdist-1.5.0-rc2~8^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F9069%2Fhead;p=thirdparty%2Fpdns.git Avoid "pthread_rwlock_destroy on rwlock with waiters!" on OpenBSD --- diff --git a/pdns/test-lock_hh.cc b/pdns/test-lock_hh.cc index 03e7554119..bdd3697504 100644 --- a/pdns/test-lock_hh.cc +++ b/pdns/test-lock_hh.cc @@ -18,7 +18,6 @@ static void lthread() std::vector rlocks; for(auto& pp : g_locks) rlocks.emplace_back(&*pp); - } BOOST_AUTO_TEST_CASE(test_pdns_lock) @@ -54,12 +53,15 @@ BOOST_AUTO_TEST_CASE(test_pdns_lock) BOOST_CHECK(!gotit); wlocks.clear(); - TryReadLock trl2(&*g_locks[0]); - BOOST_CHECK(trl2.gotIt()); - + + { + TryReadLock trl2(&*g_locks[0]); + BOOST_CHECK(trl2.gotIt()); + } + for(auto& pp : g_locks) { pthread_rwlock_destroy(pp.get()); - } + } } BOOST_AUTO_TEST_SUITE_END()