glog.go
func timeoutFlush(l *Log, timeout time.Duration) {
	done := make(chan bool, 1)
	go func() {
		l.lockAndFlushAll()
		done <- true
	}()
	select {
	case <-done:
	case <-time.After(timeout):
		fmt.Fprintln(os.Stderr, "glog: Flush took longer than", timeout)
	}
}
func timeoutFlush(l *Log, timeout time.Duration) {
	done := make(chan bool, 1)
	go func() {
		l.lockAndFlushAll()
		done <- true
	}()
	select {
	case <-done:
	case <-time.After(timeout):
		fmt.Fprintln(os.Stderr, "glog: Flush took longer than", timeout)
	}
}
func timeoutFlush ( l * Log , timeout time . Duration ) { done := make ( chan bool , 1 ) go func ( ) { l . lockAndFlushAll ( ) done <- true } ( ) select { case <- done : case <- time . After ( timeout ) : fmt . Fprintln ( os . Stderr , " " , timeout ) } }
// timeoutFlush calls Flush and returns when it completes or after timeout
// elapses, whichever happens first.  This is needed because the hooks invoked
// by Flush may deadlock when glog.Fatal is called from a hook that holds
// a lock.
timeoutFlush calls Flush and returns when it completes or after timeout elapses whichever happens first . This is needed because the hooks invoked by Flush may deadlock when glog . Fatal is called from a hook that holds a lock .