Skip to content

Commit

Permalink
Merge pull request #10105 from johncming/master
Browse files Browse the repository at this point in the history
bugfix: use Rlock instead of Lock in raftexample.
  • Loading branch information
xiang90 authored Sep 19, 2018
2 parents b9b75f8 + dd6e579 commit f32bc50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/raftexample/kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit f32bc50

Please sign in to comment.