File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ package sync
44
55import (
66 "bytes"
7- "fmt"
87 "github.com/funny/goid"
98 "runtime/pprof"
109 "strconv"
@@ -73,19 +72,21 @@ func (m *mointor) wait() int32 {
7372func (m * mointor ) verify (holder int32 , holderLink []int32 ) {
7473 if m .holder != 0 {
7574 if m .holder == holder {
76- buf := new (bytes.Buffer )
77- fmt .Fprintln (buf , "[DEAD LOCK]\n " )
78-
79- // dump goroutines
75+ // dump stack
8076 stackBuf := new (bytes.Buffer )
8177 prof := pprof .Lookup ("goroutine" )
8278 prof .WriteTo (stackBuf , 2 )
8379 stack := stackBuf .Bytes ()
84- fmt .Fprintf (buf , "%s\n \n " , traceGoroutine (holder , stack ))
80+
81+ // match goroutines
82+ buf := new (bytes.Buffer )
83+ buf .WriteString ("[DEAD LOCK]\n " )
84+ buf .Write (traceGoroutine (holder , stack ))
85+ buf .Write (goroutineEnd )
8586 for i := 0 ; i < len (holderLink ); i ++ {
86- fmt .Fprintf (buf , "%s\n \n " , traceGoroutine (holderLink [i ], stack ))
87+ buf .Write (traceGoroutine (holderLink [i ], stack ))
88+ buf .Write (goroutineEnd )
8789 }
88-
8990 panic (buf .String ())
9091 }
9192 if waitTarget , exists := waitTargets [m .holder ]; exists {
You can’t perform that action at this time.
0 commit comments