sasha-s / go-deadlock

Online deadlock detection in go (golang)
Apache License 2.0
1.03k stars 76 forks source link

the order of unlock in deadlock.go seems be strange #9

Closed ghost closed 6 years ago

ghost commented 6 years ago

in deadlock.go func lock(lockFn func(), ptr interface{}) in line 161 lo.mu.Lock() //you lock lo.mu firstly in line 167 Opts.mu.Lock() //you lock Opts.mu secondly but in line 192 lo.mu.Unlock() //you unlock lo.mu firstly in line 193 Opts.mu.UnLock() //you unlock Opts.mu secondly

Is that OK?

sasha-s commented 6 years ago

thanks, fixed in https://github.com/sasha-s/go-deadlock/commit/89fc81536521522e45c1465e2b40879d55a17406