mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: make memory storage set method thread safe
This commit is contained in:
parent
d62ce55584
commit
8151d4d0bc
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user