From 974d74befbd3ac882f012e564a5f9a3b7b35e489 Mon Sep 17 00:00:00 2001 From: evan-gu Date: Tue, 1 Oct 2013 01:25:45 -0400 Subject: [PATCH] add some comment and change a declaration form --- store/event.go | 2 +- store/node.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/store/event.go b/store/event.go index 34bdf7d9b..53d4568bd 100644 --- a/store/event.go +++ b/store/event.go @@ -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 diff --git a/store/node.go b/store/node.go index cad85c75f..f5545fa60 100644 --- a/store/node.go +++ b/store/node.go @@ -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)