mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 05:46:32 +00:00
libs: wrap mutexes for build flag with godeadlock (#5126)
## Description This PR wraps the stdlib sync.(RW)Mutex & godeadlock.(RW)Mutex. This enables using go-deadlock via a build flag instead of using sed to replace sync with godeadlock in all files Closes: #3242
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package timer
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
tmsync "github.com/tendermint/tendermint/libs/sync"
|
||||
)
|
||||
|
||||
/*
|
||||
@@ -17,7 +18,7 @@ type ThrottleTimer struct {
|
||||
quit chan struct{}
|
||||
dur time.Duration
|
||||
|
||||
mtx sync.Mutex
|
||||
mtx tmsync.Mutex
|
||||
timer *time.Timer
|
||||
isSet bool
|
||||
}
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package timer
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
// make govet noshadow happy...
|
||||
|
||||
asrt "github.com/stretchr/testify/assert"
|
||||
|
||||
tmsync "github.com/tendermint/tendermint/libs/sync"
|
||||
)
|
||||
|
||||
type thCounter struct {
|
||||
input chan struct{}
|
||||
mtx sync.Mutex
|
||||
mtx tmsync.Mutex
|
||||
count int
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user