mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
log: modify lock defer unlock order in sync handler (#24667)
This modifies the order of Lock() defer Unlock() to follow the more typically used pattern.
This commit is contained in:
parent
c1b69bd121
commit
6c3fea0fc9
1 changed files with 2 additions and 1 deletions
|
|
@ -52,8 +52,9 @@ func StreamHandler(wr io.Writer, fmtr Format) Handler {
|
|||
func SyncHandler(h Handler) Handler {
|
||||
var mu sync.Mutex
|
||||
return FuncHandler(func(r *Record) error {
|
||||
defer mu.Unlock()
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
|
||||
return h.Log(r)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue