]> granicus.if.org Git - pdns/commitdiff
Add copy-ct, gcc C++ lib <= 4.8 seems to need it.
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 7 Oct 2019 08:43:41 +0000 (10:43 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 7 Oct 2019 08:43:41 +0000 (10:43 +0200)
pdns/statbag.cc
pdns/statbag.hh

index 4900ec56e652c7d3a244a681ffa1587d32c655b7..35242e79aa86ed7215c85b79e46b0064655ce099 100644 (file)
@@ -166,6 +166,16 @@ StatRing<T,Comp>::StatRing(unsigned int size)
   d_items.set_capacity(size);
 }
 
+template<typename T, typename Comp>
+StatRing<T,Comp>::StatRing(const StatRing<T,Comp> &arg)
+{
+  std::lock_guard<std::mutex> thislock(d_lock);
+  std::lock_guard<std::mutex> arglock(arg.d_lock);
+  
+  d_items = arg.d_items;
+  d_help = arg.d_help;
+}
+
 template<typename T, typename Comp>
 void StatRing<T,Comp>::account(const T& t)
 {
index a8f5663a59995c51c087316b92a7074ba0a534b9..d593886eac28c79aa44f436f36e189d4e0174796 100644 (file)
@@ -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();