Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
KEP-1294: moved lock to preserve performance of quick read
Browse files Browse the repository at this point in the history
  • Loading branch information
paularchard committed Mar 27, 2019
1 parent 440bde1 commit 45d807b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pbft/pbft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,12 +1102,11 @@ pbft::handle_database_message(const bzn_envelope& msg, std::shared_ptr<bzn::sess
mutable_msg.set_timestamp(this->now());
}

std::lock_guard<std::mutex> lock(this->pbft_lock);

LOG(debug) << "got database message";

if (!this->service->apply_operation_now(msg, session))
{
std::lock_guard<std::mutex> lock(this->pbft_lock);
this->handle_request(mutable_msg, session);
}
}
Expand Down

0 comments on commit 45d807b

Please sign in to comment.