From e47ce81422e436459dabf803676d3a3d6924699b Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Thu, 28 Dec 2017 03:02:23 -0800 Subject: [PATCH] Comment fixes from Emmanuel --- clist/clist.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clist/clist.go b/clist/clist.go index 02e31a50..a52920f8 100644 --- a/clist/clist.go +++ b/clist/clist.go @@ -18,7 +18,7 @@ import ( /* CElement is an element of a linked-list -Traversal from a CElement are goroutine-safe. +Traversal from a CElement is goroutine-safe. We can't avoid using WaitGroups or for-loops given the documentation spec without re-implementing the primitives that already exist in @@ -220,6 +220,7 @@ func (l *CList) Front() *CElement { } func (l *CList) FrontWait() *CElement { + // Loop until the head is non-nil else wait and try again for { l.mtx.RLock() head := l.head @@ -230,8 +231,7 @@ func (l *CList) FrontWait() *CElement { return head } wg.Wait() - // l.head doesn't necessarily exist here. - // That's why we need to continue a for-loop. + // NOTE: If you think l.head exists here, think harder. } }