Use lock when creating peer shard rangeset

This commit is contained in:
Miguel Portilla
2018-02-26 11:45:52 -05:00
parent 6230204e42
commit 2fee75bfc1

View File

@@ -1381,9 +1381,10 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMStatusChange> const& m)
if (m->has_shardseqs())
{
shards_.clear();
std::vector<std::string> tokens;
boost::split(tokens, m->shardseqs(), boost::algorithm::is_any_of(","));
std::lock_guard<std::mutex> sl(recentLock_);
shards_.clear();
for (auto const& t : tokens)
{
std::vector<std::string> seqs;