From: Otto Moerbeek Date: Mon, 7 Oct 2019 08:43:41 +0000 (+0200) Subject: Add copy-ct, gcc C++ lib <= 4.8 seems to need it. X-Git-Tag: dnsdist-1.4.0-rc4~39^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f979b818042f8f3103c0b35bfbbed354a1b23779;p=pdns Add copy-ct, gcc C++ lib <= 4.8 seems to need it. --- diff --git a/pdns/statbag.cc b/pdns/statbag.cc index 4900ec56e..35242e79a 100644 --- a/pdns/statbag.cc +++ b/pdns/statbag.cc @@ -166,6 +166,16 @@ StatRing::StatRing(unsigned int size) d_items.set_capacity(size); } +template +StatRing::StatRing(const StatRing &arg) +{ + std::lock_guard thislock(d_lock); + std::lock_guard arglock(arg.d_lock); + + d_items = arg.d_items; + d_help = arg.d_help; +} + template void StatRing::account(const T& t) { diff --git a/pdns/statbag.hh b/pdns/statbag.hh index a8f5663a5..d593886ea 100644 --- a/pdns/statbag.hh +++ b/pdns/statbag.hh @@ -39,6 +39,9 @@ class StatRing { public: StatRing(unsigned int size=10000); + // Some older C++ libs have trouble emplacing without a copy-contructor, so provide one + StatRing(const StatRing &); + void account(const T &item); unsigned int getSize();