From: Remi Gacogne Date: Wed, 6 Jan 2021 10:41:13 +0000 (+0100) Subject: rec: Add warning about trying to get the lock instead of waiting X-Git-Tag: dnsdist-1.6.0-alpha2~12^2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3336f1a96c693123d008e911f965c9bd0283e12;p=thirdparty%2Fpdns.git rec: Add warning about trying to get the lock instead of waiting --- 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;