From: Chris Hofstaedtler Date: Mon, 10 May 2021 08:16:10 +0000 (+0200) Subject: setReplacePending: avoid lock X-Git-Tag: auth-4.5.0-alpha1~7^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3922d8badb811bf246f9663df102e029879d0dd;p=thirdparty%2Fpdns.git setReplacePending: avoid lock --- diff --git a/pdns/auth-domaincache.cc b/pdns/auth-domaincache.cc index df86df8483..d3c55bbf5c 100644 --- a/pdns/auth-domaincache.cc +++ b/pdns/auth-domaincache.cc @@ -160,7 +160,9 @@ void AuthDomainCache::setReplacePending() if (!d_ttl) return; - WriteLock globalLock(d_mut); - d_replacePending = true; - d_pendingAdds.clear(); + { + WriteLock globalLock(d_mut); + d_replacePending = true; + d_pendingAdds.clear(); + } }