Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
c37e68e7
Unverified
Commit
c37e68e7
authored
Oct 13, 2020
by
mr_franklin
Committed by
GitHub
Oct 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: replace RWMutex with Mutex in places where RLock is not used (#21622)
parent
32341f88
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
7 deletions
+6
-7
file_cache.go
accounts/keystore/file_cache.go
+1
-1
chain_indexer.go
core/chain_indexer.go
+1
-1
downloader.go
eth/downloader/downloader.go
+1
-1
downloader_test.go
eth/downloader/downloader_test.go
+1
-2
txrelay.go
les/txrelay.go
+1
-1
unconfirmed.go
miner/unconfirmed.go
+1
-1
No files found.
accounts/keystore/file_cache.go
View file @
c37e68e7
...
@@ -32,7 +32,7 @@ import (
...
@@ -32,7 +32,7 @@ import (
type
fileCache
struct
{
type
fileCache
struct
{
all
mapset
.
Set
// Set of all files from the keystore folder
all
mapset
.
Set
// Set of all files from the keystore folder
lastMod
time
.
Time
// Last time instance when a file was modified
lastMod
time
.
Time
// Last time instance when a file was modified
mu
sync
.
RW
Mutex
mu
sync
.
Mutex
}
}
// scan performs a new scan on the given directory, compares against the already
// scan performs a new scan on the given directory, compares against the already
...
...
core/chain_indexer.go
View file @
c37e68e7
...
@@ -94,7 +94,7 @@ type ChainIndexer struct {
...
@@ -94,7 +94,7 @@ type ChainIndexer struct {
throttling
time
.
Duration
// Disk throttling to prevent a heavy upgrade from hogging resources
throttling
time
.
Duration
// Disk throttling to prevent a heavy upgrade from hogging resources
log
log
.
Logger
log
log
.
Logger
lock
sync
.
RW
Mutex
lock
sync
.
Mutex
}
}
// NewChainIndexer creates a new chain indexer to do background processing on
// NewChainIndexer creates a new chain indexer to do background processing on
...
...
eth/downloader/downloader.go
View file @
c37e68e7
...
@@ -153,7 +153,7 @@ type Downloader struct {
...
@@ -153,7 +153,7 @@ type Downloader struct {
cancelWg
sync
.
WaitGroup
// Make sure all fetcher goroutines have exited.
cancelWg
sync
.
WaitGroup
// Make sure all fetcher goroutines have exited.
quitCh
chan
struct
{}
// Quit channel to signal termination
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
// Testing hooks
syncInitHook
func
(
uint64
,
uint64
)
// Method to call upon initiating a new sync run
syncInitHook
func
(
uint64
,
uint64
)
// Method to call upon initiating a new sync run
...
...
eth/downloader/downloader_test.go
View file @
c37e68e7
...
@@ -411,7 +411,6 @@ func (dl *downloadTester) dropPeer(id string) {
...
@@ -411,7 +411,6 @@ func (dl *downloadTester) dropPeer(id string) {
type
downloadTesterPeer
struct
{
type
downloadTesterPeer
struct
{
dl
*
downloadTester
dl
*
downloadTester
id
string
id
string
lock
sync
.
RWMutex
chain
*
testChain
chain
*
testChain
missingStates
map
[
common
.
Hash
]
bool
// State entries that fast sync should not return
missingStates
map
[
common
.
Hash
]
bool
// State entries that fast sync should not return
}
}
...
@@ -1601,7 +1600,7 @@ func TestRemoteHeaderRequestSpan(t *testing.T) {
...
@@ -1601,7 +1600,7 @@ func TestRemoteHeaderRequestSpan(t *testing.T) {
{
15000
,
13006
,
{
15000
,
13006
,
[]
int
{
14823
,
14839
,
14855
,
14871
,
14887
,
14903
,
14919
,
14935
,
14951
,
14967
,
14983
,
14999
},
[]
int
{
14823
,
14839
,
14855
,
14871
,
14887
,
14903
,
14919
,
14935
,
14951
,
14967
,
14983
,
14999
},
},
},
//Remote is pretty close to us. We don't have to fetch as many
//
Remote is pretty close to us. We don't have to fetch as many
{
1200
,
1150
,
{
1200
,
1150
,
[]
int
{
1149
,
1154
,
1159
,
1164
,
1169
,
1174
,
1179
,
1184
,
1189
,
1194
,
1199
},
[]
int
{
1149
,
1154
,
1159
,
1164
,
1169
,
1174
,
1179
,
1184
,
1189
,
1194
,
1199
},
},
},
...
...
les/txrelay.go
View file @
c37e68e7
...
@@ -35,7 +35,7 @@ type lesTxRelay struct {
...
@@ -35,7 +35,7 @@ type lesTxRelay struct {
txPending
map
[
common
.
Hash
]
struct
{}
txPending
map
[
common
.
Hash
]
struct
{}
peerList
[]
*
serverPeer
peerList
[]
*
serverPeer
peerStartPos
int
peerStartPos
int
lock
sync
.
RW
Mutex
lock
sync
.
Mutex
stop
chan
struct
{}
stop
chan
struct
{}
retriever
*
retrieveManager
retriever
*
retrieveManager
...
...
miner/unconfirmed.go
View file @
c37e68e7
...
@@ -50,7 +50,7 @@ type unconfirmedBlocks struct {
...
@@ -50,7 +50,7 @@ type unconfirmedBlocks struct {
chain
chainRetriever
// Blockchain to verify canonical status through
chain
chainRetriever
// Blockchain to verify canonical status through
depth
uint
// Depth after which to discard previous blocks
depth
uint
// Depth after which to discard previous blocks
blocks
*
ring
.
Ring
// Block infos to allow canonical chain cross checks
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.
// newUnconfirmedBlocks returns new data structure to track currently unconfirmed blocks.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment