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
a196f3e8
Unverified
Commit
a196f3e8
authored
Jul 24, 2023
by
ucwong
Committed by
GitHub
Jul 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/devp2p: atomic types used (#27755)
parent
7a1fba1a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
crawl.go
cmd/devp2p/crawl.go
+15
-15
No files found.
cmd/devp2p/crawl.go
View file @
a196f3e8
...
@@ -87,11 +87,11 @@ func (c *crawler) run(timeout time.Duration, nthreads int) nodeSet {
...
@@ -87,11 +87,11 @@ func (c *crawler) run(timeout time.Duration, nthreads int) nodeSet {
go
c
.
runIterator
(
doneCh
,
it
)
go
c
.
runIterator
(
doneCh
,
it
)
}
}
var
(
var
(
added
u
int64
added
atomic
.
U
int64
updated
u
int64
updated
atomic
.
U
int64
skipped
u
int64
skipped
atomic
.
U
int64
recent
u
int64
recent
atomic
.
U
int64
removed
u
int64
removed
atomic
.
U
int64
wg
sync
.
WaitGroup
wg
sync
.
WaitGroup
)
)
wg
.
Add
(
nthreads
)
wg
.
Add
(
nthreads
)
...
@@ -103,15 +103,15 @@ func (c *crawler) run(timeout time.Duration, nthreads int) nodeSet {
...
@@ -103,15 +103,15 @@ func (c *crawler) run(timeout time.Duration, nthreads int) nodeSet {
case
n
:=
<-
c
.
ch
:
case
n
:=
<-
c
.
ch
:
switch
c
.
updateNode
(
n
)
{
switch
c
.
updateNode
(
n
)
{
case
nodeSkipIncompat
:
case
nodeSkipIncompat
:
atomic
.
AddUint64
(
&
skipped
,
1
)
skipped
.
Add
(
1
)
case
nodeSkipRecent
:
case
nodeSkipRecent
:
atomic
.
AddUint64
(
&
recent
,
1
)
recent
.
Add
(
1
)
case
nodeRemoved
:
case
nodeRemoved
:
atomic
.
AddUint64
(
&
removed
,
1
)
removed
.
Add
(
1
)
case
nodeAdded
:
case
nodeAdded
:
a
tomic
.
AddUint64
(
&
added
,
1
)
a
dded
.
Add
(
1
)
default
:
default
:
atomic
.
AddUint64
(
&
updated
,
1
)
updated
.
Add
(
1
)
}
}
case
<-
c
.
closed
:
case
<-
c
.
closed
:
return
return
...
@@ -138,11 +138,11 @@ loop:
...
@@ -138,11 +138,11 @@ loop:
break
loop
break
loop
case
<-
statusTicker
.
C
:
case
<-
statusTicker
.
C
:
log
.
Info
(
"Crawling in progress"
,
log
.
Info
(
"Crawling in progress"
,
"added"
,
a
tomic
.
LoadUint64
(
&
added
),
"added"
,
a
dded
.
Load
(
),
"updated"
,
atomic
.
LoadUint64
(
&
updated
),
"updated"
,
updated
.
Load
(
),
"removed"
,
atomic
.
LoadUint64
(
&
removed
),
"removed"
,
removed
.
Load
(
),
"ignored(recent)"
,
atomic
.
LoadUint64
(
&
recent
),
"ignored(recent)"
,
recent
.
Load
(
),
"ignored(incompatible)"
,
atomic
.
LoadUint64
(
&
skipped
))
"ignored(incompatible)"
,
skipped
.
Load
(
))
}
}
}
}
...
...
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