Skip to content

Commit

Permalink
[FOLD] Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelportilla committed Dec 8, 2020
1 parent 7e8e116 commit 79839d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/ripple/nodestore/impl/Shard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ Shard::setLedgerStored(std::shared_ptr<Ledger const> const& ledger)
if (!scopedCount)
return false;

// This lock is used as an optimization to prevent unneeded
// calls to storeSQLite before acquireInfo_ is updated
std::lock_guard storedLock(storedMutex_);

{
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/nodestore/impl/Shard.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class Shard final
Application& app_;
beast::Journal const j_;
mutable std::mutex mutex_;
std::mutex storedMutex_;
mutable std::mutex storedMutex_;

// Shard Index
std::uint32_t const index_;
Expand Down

0 comments on commit 79839d4

Please sign in to comment.