forked from cerc-io/plugeth
all: replace RWMutex with Mutex in places where RLock is not used (#21622)
This commit is contained in:
parent
32341f88e3
commit
c37e68e7c1
@ -32,7 +32,7 @@ import (
|
||||
type fileCache struct {
|
||||
all mapset.Set // Set of all files from the keystore folder
|
||||
lastMod time.Time // Last time instance when a file was modified
|
||||
mu sync.RWMutex
|
||||
mu sync.Mutex
|
||||
}
|
||||
|
||||
// scan performs a new scan on the given directory, compares against the already
|
||||
|
@ -94,7 +94,7 @@ type ChainIndexer struct {
|
||||
throttling time.Duration // Disk throttling to prevent a heavy upgrade from hogging resources
|
||||
|
||||
log log.Logger
|
||||
lock sync.RWMutex
|
||||
lock sync.Mutex
|
||||
}
|
||||
|
||||
// NewChainIndexer creates a new chain indexer to do background processing on
|
||||
|
@ -153,7 +153,7 @@ type Downloader struct {
|
||||
cancelWg sync.WaitGroup // Make sure all fetcher goroutines have exited.
|
||||
|
||||
quitCh chan struct{} // Quit channel to signal termination
|
||||
quitLock sync.RWMutex // Lock to prevent double closes
|
||||
quitLock sync.Mutex // Lock to prevent double closes
|
||||
|
||||
// Testing hooks
|
||||
syncInitHook func(uint64, uint64) // Method to call upon initiating a new sync run
|
||||
|
@ -411,7 +411,6 @@ func (dl *downloadTester) dropPeer(id string) {
|
||||
type downloadTesterPeer struct {
|
||||
dl *downloadTester
|
||||
id string
|
||||
lock sync.RWMutex
|
||||
chain *testChain
|
||||
missingStates map[common.Hash]bool // State entries that fast sync should not return
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ type lesTxRelay struct {
|
||||
txPending map[common.Hash]struct{}
|
||||
peerList []*serverPeer
|
||||
peerStartPos int
|
||||
lock sync.RWMutex
|
||||
lock sync.Mutex
|
||||
stop chan struct{}
|
||||
|
||||
retriever *retrieveManager
|
||||
|
@ -50,7 +50,7 @@ type unconfirmedBlocks struct {
|
||||
chain chainRetriever // Blockchain to verify canonical status through
|
||||
depth uint // Depth after which to discard previous blocks
|
||||
blocks *ring.Ring // Block infos to allow canonical chain cross checks
|
||||
lock sync.RWMutex // Protects the fields from concurrent access
|
||||
lock sync.Mutex // Protects the fields from concurrent access
|
||||
}
|
||||
|
||||
// newUnconfirmedBlocks returns new data structure to track currently unconfirmed blocks.
|
||||
|
Loading…
Reference in New Issue
Block a user