// Wake satisfies the Waker interface.
Wake satisfies the Waker interface.
// Wake satisfies the Waker interface .
func (t *testWaker) Wake() (w <-chan struct{}) {
	t.mu.Lock()
	w = t.wake
	t.mu.Unlock()
	glog.Infof("waiting for wake on chan %p", w)
	go func() {
		select {
		case <-t.ctx.Done():
			return
		case t.wakeeDone <- struct{}{}:
		}
		select {
		case <-t.ctx.Done():
			return
		case <-t.wait:
		}
		select {
		case <-t.ctx.Done():
			return
		case t.wakeeReady <- struct{}{}:
		}
	}()
	return
}
func ( t * testWaker ) Wake ( ) ( w <- chan struct { } ) { t . mu . Lock ( ) w = t . wake t . mu . Unlock ( ) glog . Infof ( " " , w ) go func ( ) { select { case <- t . ctx . Done ( ) : return case t . wakeeDone <- struct { } { } : } select { case <- t . ctx . Done ( ) : return case <- t . wait : } select { case <- t . ctx . Done ( ) : return case t . wakeeReady <- struct { } { } : } } ( ) return }
Wake satisfies the Waker interface.
Wake satisfies the Waker interface .
// Background this so we can return the wake channel. // The wakeFunc won't close the channel until this completes. // Signal we've reentered Wake.  wakeFunc can't return until we do this. // Block wakees here until a subsequent wakeFunc is called. // Signal we've got the wake chan, telling wakeFunc it can now issue a broadcast.