Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
0f5cc8bd
Commit
0f5cc8bd
authored
Feb 26, 2021
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a startup race by creating the blockstoremanager process on init
parent
47b99b1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
internal/decision/blockstoremanager.go
internal/decision/blockstoremanager.go
+6
-6
No files found.
internal/decision/blockstoremanager.go
View file @
0f5cc8bd
...
@@ -26,24 +26,24 @@ func newBlockstoreManager(bs bstore.Blockstore, workerCount int) *blockstoreMana
...
@@ -26,24 +26,24 @@ func newBlockstoreManager(bs bstore.Blockstore, workerCount int) *blockstoreMana
bs
:
bs
,
bs
:
bs
,
workerCount
:
workerCount
,
workerCount
:
workerCount
,
jobs
:
make
(
chan
func
()),
jobs
:
make
(
chan
func
()),
px
:
process
.
WithTeardown
(
func
()
error
{
return
nil
}),
}
}
}
}
func
(
bsm
*
blockstoreManager
)
start
(
px
process
.
Process
)
{
func
(
bsm
*
blockstoreManager
)
start
(
px
process
.
Process
)
{
bsm
.
px
=
px
px
.
AddChild
(
bsm
.
px
)
// Start up workers
// Start up workers
for
i
:=
0
;
i
<
bsm
.
workerCount
;
i
++
{
for
i
:=
0
;
i
<
bsm
.
workerCount
;
i
++
{
px
.
Go
(
func
(
px
process
.
Process
)
{
bsm
.
px
.
Go
(
func
(
px
process
.
Process
)
{
bsm
.
worker
()
bsm
.
worker
(
px
)
})
})
}
}
}
}
func
(
bsm
*
blockstoreManager
)
worker
()
{
func
(
bsm
*
blockstoreManager
)
worker
(
px
process
.
Process
)
{
for
{
for
{
select
{
select
{
case
<-
bsm
.
px
.
Closing
()
:
case
<-
px
.
Closing
()
:
return
return
case
job
:=
<-
bsm
.
jobs
:
case
job
:=
<-
bsm
.
jobs
:
job
()
job
()
...
...
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