mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
all: replace RWMutex with Mutex in places where RLock is not used (#21622)
This commit is contained in:
parent
5b48621c36
commit
d8c9ad3c9f
5 changed files with 5 additions and 5 deletions
|
|
@ -31,7 +31,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
|
||||
|
|
|
|||
|
|
@ -86,7 +86,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
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ type Downloader struct {
|
|||
cancelLock sync.RWMutex // Lock to protect the cancel channel and peer in delivers
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ type LesTxRelay struct {
|
|||
ps *peerSet
|
||||
peerList []*peer
|
||||
peerStartPos int
|
||||
lock sync.RWMutex
|
||||
lock sync.Mutex
|
||||
|
||||
reqDist *requestDistributor
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ type unconfirmedBlocks struct {
|
|||
chain headerRetriever // 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 a new issue