Merge pull request #10105 from johncming/master

bugfix: use Rlock instead of Lock in raftexample.
This commit is contained in:
Xiang Li
2018-09-19 15:50:41 -07:00
committed by GitHub

View File

@@ -95,8 +95,8 @@ func (s *kvstore) readCommits(commitC <-chan *string, errorC <-chan error) {
}
func (s *kvstore) getSnapshot() ([]byte, error) {
s.mu.Lock()
defer s.mu.Unlock()
s.mu.RLock()
defer s.mu.RUnlock()
return json.Marshal(s.kvStore)
}