deadlock.go
func (l *lockOrder) other(ptr interface{}) {
	empty := true
	for k := range l.cur {
		if k == ptr {
			continue
		}
		empty = false
	}
	if empty {
		return
	}
	fmt.Fprintln(Opts.LogBuf, "Other goroutines holding locks:")
	for k, pp := range l.cur {
		if k == ptr {
			continue
		}
		fmt.Fprintf(Opts.LogBuf, "goroutine %v lock %p\n", pp.gid, k)
		printStack(Opts.LogBuf, pp.stack)
	}
	fmt.Fprintln(Opts.LogBuf)
}
func (l *lockOrder) other(ptr interface{}) {
	empty := true
	for k := range l.cur {
		if k == ptr {
			continue
		}
		empty = false
	}
	if empty {
		return
	}
	fmt.Fprintln(Opts.LogBuf, "Other goroutines holding locks:")
	for k, pp := range l.cur {
		if k == ptr {
			continue
		}
		fmt.Fprintf(Opts.LogBuf, "goroutine %v lock %p\n", pp.gid, k)
		printStack(Opts.LogBuf, pp.stack)
	}
	fmt.Fprintln(Opts.LogBuf)
}
func ( l * lockOrder ) other ( ptr interface { } ) { empty := true for k := range l . cur { if k == ptr { continue } empty = false } if empty { return } fmt . Fprintln ( Opts . LogBuf , " " ) for k , pp := range l . cur { if k == ptr { continue } fmt . Fprintf ( Opts . LogBuf , " \n " , pp . gid , k ) printStack ( Opts . LogBuf , pp . stack ) } fmt . Fprintln ( Opts . LogBuf ) }
// Under lo.mu Locked.
Under lo . mu Locked .