refactor: Change boost::shared_mutex to std::shared_mutex (#5576)

This change reverts the usage of boost::shared_mutex back to std::shared_mutex. The change was originally introduced as a workaround for a bug in glibc 2.28 and older versions, which could cause threads using std::shared_mutex to stall. This issue primarily affected Ubuntu 18.04 and earlier distributions, which we no longer support.
This commit is contained in:
Vito Tumas
2025-07-21 15:14:22 +02:00
committed by GitHub
parent 13353ae36d
commit e95683a0fb
2 changed files with 3 additions and 3 deletions

View File

@@ -226,7 +226,7 @@ class ValidatorList
TimeKeeper& timeKeeper_;
boost::filesystem::path const dataPath_;
beast::Journal const j_;
boost::shared_mutex mutable mutex_;
std::shared_mutex mutable mutex_;
using lock_guard = std::lock_guard<decltype(mutex_)>;
using shared_lock = std::shared_lock<decltype(mutex_)>;

View File

@@ -98,7 +98,7 @@ private:
// Node public key of peer.
PublicKey const publicKey_;
std::string name_;
boost::shared_mutex mutable nameMutex_;
std::shared_mutex mutable nameMutex_;
// The indices of the smallest and largest ledgers this peer has available
//
@@ -214,7 +214,7 @@ private:
total_bytes() const;
private:
boost::shared_mutex mutable mutex_;
std::shared_mutex mutable mutex_;
boost::circular_buffer<std::uint64_t> rollingAvg_{30, 0ull};
clock_type::time_point intervalStart_{clock_type::now()};
std::uint64_t totalBytes_{0};