Skip to content

Commit

Permalink
Protecting peer list with mutex
Browse files Browse the repository at this point in the history
Signed-off-by: Gautam Venkataramanan <gautam.chennai@gmail.com>
  • Loading branch information
gautvenk committed Jun 24, 2020
1 parent 6dcf182 commit 67802ee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libopflex/comms/loopdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ void internal::Peer::LoopData::destroy(bool now) {
destroying_ = true;
down();

opflex::util::LockGuard guard(&peerMutex);
for (size_t i=0; i < Peer::LoopData::TOTAL_STATES; ++i) {
peers[Peer::LoopData::PeerState(i)]
.clear_and_dispose(PeerDisposer(now));
Expand Down

0 comments on commit 67802ee

Please sign in to comment.