void set_mon_addrs(const MonMap& mm);
void set_mon_addrs(const std::vector<entity_addrvec_t>& in) {
auto ptr = std::make_shared<std::vector<entity_addrvec_t>>(in);
+#if defined(__GNUC__) && __GNUC__ < 12
+ // workaround for GCC 11 bug
atomic_store_explicit(&_mon_addrs, std::move(ptr), std::memory_order_relaxed);
+#else
+ _mon_addrs.store(std::move(ptr), std::memory_order_relaxed);
+#endif
}
std::shared_ptr<std::vector<entity_addrvec_t>> get_mon_addrs() const {
+#if defined(__GNUC__) && __GNUC__ < 12
+ // workaround for GCC 11 bug
auto ptr = atomic_load_explicit(&_mon_addrs, std::memory_order_relaxed);
+#else
+ auto ptr = _mon_addrs.load(std::memory_order_relaxed);
+#endif
return ptr;
}
int _crypto_inited;
+#if defined(__GNUC__) && __GNUC__ < 12
+ // workaround for GCC 11 bug
std::shared_ptr<std::vector<entity_addrvec_t>> _mon_addrs;
+#else
+ std::atomic<std::shared_ptr<std::vector<entity_addrvec_t>>> _mon_addrs;
+#endif
/* libcommon service thread.
* SIGHUP wakes this thread, which then reopens logfiles */