remove mutex and dead references

This commit is contained in:
Valentin Balaschenko
2025-06-13 14:45:27 +01:00
parent 984c70955a
commit d0f836581b
4 changed files with 6 additions and 15 deletions

View File

@@ -21,7 +21,6 @@
#define RIPPLE_BASICS_SHAMAP_HASH_H_INCLUDED
#include <xrpl/basics/base_uint.h>
#include <xrpl/basics/partitioned_unordered_map.h>
#include <ostream>

View File

@@ -297,8 +297,7 @@ private:
[[maybe_unused]] clock_type::time_point const& now,
typename KeyValueCacheType::map_type& partition,
SweptPointersVector& stuffToSweep,
std::atomic<int>& allRemovals,
std::lock_guard<std::recursive_mutex> const&);
std::atomic<int>& allRemoval);
[[nodiscard]] std::thread
sweepHelper(
@@ -306,15 +305,12 @@ private:
clock_type::time_point const& now,
typename KeyOnlyCacheType::map_type& partition,
SweptPointersVector&,
std::atomic<int>& allRemovals,
std::lock_guard<std::recursive_mutex> const&);
std::atomic<int>& allRemovals);
beast::Journal m_journal;
clock_type& m_clock;
Stats m_stats;
mutex_type mutable m_mutex;
// Used for logging
std::string m_name;

View File

@@ -293,7 +293,7 @@ TaggedCache<
auto const start = std::chrono::steady_clock::now();
{
std::lock_guard lock(m_mutex);
// TODO: lock the cache partition
if (m_target_size == 0 ||
(static_cast<int>(m_cache.size()) <= m_target_size))
@@ -325,8 +325,7 @@ TaggedCache<
now,
m_cache.map()[p],
allStuffToSweep[p],
allRemovals,
lock));
allRemovals));
}
for (std::thread& worker : workers)
worker.join();
@@ -867,8 +866,7 @@ TaggedCache<
[[maybe_unused]] clock_type::time_point const& now,
typename KeyValueCacheType::map_type& partition,
SweptPointersVector& stuffToSweep,
std::atomic<int>& allRemovals,
std::lock_guard<std::recursive_mutex> const&)
std::atomic<int>& allRemovals)
{
return std::thread([&, this]() {
int cacheRemovals = 0;
@@ -956,8 +954,7 @@ TaggedCache<
clock_type::time_point const& now,
typename KeyOnlyCacheType::map_type& partition,
SweptPointersVector&,
std::atomic<int>& allRemovals,
std::lock_guard<std::recursive_mutex> const&)
std::atomic<int>& allRemovals)
{
return std::thread([&, this]() {
int cacheRemovals = 0;