Browse Source

Comment fixes from Emmanuel

pull/1842/head
Jae Kwon 7 years ago
parent
commit
e47ce81422
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      clist/clist.go

+ 3
- 3
clist/clist.go View File

@ -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.
}
}


Loading…
Cancel
Save