mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #10105 from johncming/master
bugfix: use Rlock instead of Lock in raftexample.
This commit is contained in:
commit
f32bc50765
@ -95,8 +95,8 @@ func (s *kvstore) readCommits(commitC <-chan *string, errorC <-chan error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *kvstore) getSnapshot() ([]byte, error) {
|
func (s *kvstore) getSnapshot() ([]byte, error) {
|
||||||
s.mu.Lock()
|
s.mu.RLock()
|
||||||
defer s.mu.Unlock()
|
defer s.mu.RUnlock()
|
||||||
return json.Marshal(s.kvStore)
|
return json.Marshal(s.kvStore)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user