(note interface{})
| 14 | } |
| 15 | |
| 16 | func (q *noteQueue) Add(note interface{}) (one bool) { |
| 17 | q.mu.Lock() |
| 18 | q.notes = append(q.notes, note) |
| 19 | n := len(q.notes) |
| 20 | q.mu.Unlock() |
| 21 | return n == 1 |
| 22 | } |
| 23 | |
| 24 | func (q *noteQueue) ForEach(iter func(note interface{}) error) error { |
| 25 | q.mu.Lock() |
no outgoing calls