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-unixfs
Commits
c100390a
Commit
c100390a
authored
Jan 03, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bitswap engine: signal in own func
parent
62362584
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
exchange/bitswap/decision/engine.go
exchange/bitswap/decision/engine.go
+10
-5
No files found.
exchange/bitswap/decision/engine.go
View file @
c100390a
...
...
@@ -143,13 +143,10 @@ func (e *Engine) MessageReceived(p peer.ID, m bsmsg.BitSwapMessage) error {
newWorkExists
:=
false
defer
func
()
{
if
newWorkExists
{
// Signal task generation to restart (if stopped!)
select
{
case
e
.
workSignal
<-
struct
{}{}
:
default
:
}
e
.
signalNewWork
()
}
}()
e
.
lock
.
Lock
()
defer
e
.
lock
.
Unlock
()
...
...
@@ -222,3 +219,11 @@ func (e *Engine) findOrCreate(p peer.ID) *ledger {
}
return
l
}
func
(
e
*
Engine
)
signalNewWork
()
{
// Signal task generation to restart (if stopped!)
select
{
case
e
.
workSignal
<-
struct
{}{}
:
default
:
}
}
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