From d3336f1a96c693123d008e911f965c9bd0283e12 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 6 Jan 2021 11:41:13 +0100 Subject: [PATCH] rec: Add warning about trying to get the lock instead of waiting --- pdns/recursordist/aggressive_nsec.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pdns/recursordist/aggressive_nsec.cc b/pdns/recursordist/aggressive_nsec.cc index d6bbef6401..fdac6802eb 100644 --- a/pdns/recursordist/aggressive_nsec.cc +++ b/pdns/recursordist/aggressive_nsec.cc @@ -35,6 +35,7 @@ std::shared_ptr AggressiveNSECCache::getBestZone { std::shared_ptr entry{nullptr}; { + #warning tryreadlock? ReadLock rl(d_lock); auto got = d_zones.lookup(zone); if (got) { @@ -205,8 +206,9 @@ void AggressiveNSECCache::insertNSEC(const DNSName& zone, const DNSName& owner, ++d_entriesCount; } -bool AggressiveNSECCache::getNSECBefore(time_t now, std::shared_ptr& zoneEntry, const DNSName& name, ZoneEntry::CacheEntry& entry) { - +bool AggressiveNSECCache::getNSECBefore(time_t now, std::shared_ptr& zoneEntry, const DNSName& name, ZoneEntry::CacheEntry& entry) +{ + #warning try? std::lock_guard lock(zoneEntry->d_lock); if (zoneEntry->d_entries.empty()) { return false; @@ -260,8 +262,9 @@ bool AggressiveNSECCache::getNSECBefore(time_t now, std::shared_ptr& zoneEntry, const DNSName& name, ZoneEntry::CacheEntry& entry) { - +bool AggressiveNSECCache::getNSEC3(time_t now, std::shared_ptr& zoneEntry, const DNSName& name, ZoneEntry::CacheEntry& entry) +{ + #warning try? std::lock_guard lock(zoneEntry->d_lock); if (zoneEntry->d_entries.empty()) { return false; -- 2.47.2