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 1, 2017
1 parent 1540741 commit f235eed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/ripple/nodestore/impl/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ void
Database::waitReads()
{
std::unique_lock<std::mutex> l(readLock_);
// Wake in two generations
// Wake in two generations.
// Each generation is a full pass over the space.
// If we're in generation N and you issue a request,
// that request will only be done during generation N
// if it happens to land after where the pass currently is.
// But, if not, it will definitely be done during generation
// N+1 since the request was in the table before that pass
// even started. So when you reach generation N+2,
// you know the request is done.
std::uint64_t const wakeGen = readGen_ + 2;
while (! readShut_ && ! read_.empty() && (readGen_ < wakeGen))
readGenCondVar_.wait(l);
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/nodestore/impl/DatabaseShardImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ DatabaseShardImp::selectCache(std::uint32_t seq)
cache = std::make_pair(incomplete_->pCache(),
incomplete_->nCache());
}
return std::move(cache);
return cache;
}


Expand Down
3 changes: 1 addition & 2 deletions src/ripple/shamap/SHAMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ class SHAMap
mutable SHAMapState state_;
SHAMapType type_;
bool backed_ = true; // Map is backed by the database
bool full_ = false; // Indicates all nodes should reside in a local store.

bool full_ = false; // Map is believed complete in database

public:
class version
Expand Down

0 comments on commit f235eed

Please sign in to comment.