mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #7041 from m1093782566/raft-safe
raft: make memory storage set method thread safe
This commit is contained in:
@@ -98,6 +98,8 @@ func (ms *MemoryStorage) InitialState() (pb.HardState, pb.ConfState, error) {
|
||||
|
||||
// SetHardState saves the current HardState.
|
||||
func (ms *MemoryStorage) SetHardState(st pb.HardState) error {
|
||||
ms.Lock()
|
||||
defer ms.Unlock()
|
||||
ms.hardState = st
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user