C returns the current channel to select on. Must be captured before entering select so a concurrent Broadcast() cannot be missed.
()
| 257 | // C returns the current channel to select on. Must be captured before |
| 258 | // entering select so a concurrent Broadcast() cannot be missed. |
| 259 | func (w *waker) C() <-chan struct{} { |
| 260 | w.mu.Lock() |
| 261 | defer w.mu.Unlock() |
| 262 | return w.ch |
| 263 | } |
| 264 | |
| 265 | // Broadcast unblocks all goroutines currently waiting on C(). |
| 266 | func (w *waker) Broadcast() { |
no outgoing calls