mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
add some comment and change a declaration form
This commit is contained in:
parent
6f591032ef
commit
974d74befb
@ -111,7 +111,7 @@ func (eh *EventHistory) addEvent(e *Event) *Event {
|
||||
eh.rwl.Lock()
|
||||
defer eh.rwl.Unlock()
|
||||
|
||||
duped := uint64(0)
|
||||
var duped uint64
|
||||
|
||||
if e.Index == UndefIndex {
|
||||
e.Index = eh.LastIndex
|
||||
|
@ -277,7 +277,8 @@ func (n *Node) Expire(s *Store) {
|
||||
// if timeout, delete the node
|
||||
case <-time.After(duration):
|
||||
|
||||
// Lock to avoid race
|
||||
// Lock the worldLock to avoid race on s.WatchHub,
|
||||
// and the race with other slibling nodes on their common parent.
|
||||
s.worldLock.Lock()
|
||||
|
||||
e := newEvent(Expire, n.Path, UndefIndex, UndefTerm)
|
||||
|
Loading…
x
Reference in New Issue
Block a user