move taskdone inside lock boundaries
Jeromy committed
May 16, 2015 at 17:16 UTC
65f815a27b20c75e2e59043176f3452f642b53b5
1 file changed
+1
-1
exchange/bitswap/decision/peer_request_queue.go
+1
-1
@@ -69,8 +69,8 @@ func (tl *prq) Push(entry wantlist.Entry, to peer.ID) {
69
Target: to,
70
created: time.Now(),
71
Done: func() {
72
- partner.TaskDone(entry.Key)
72
tl.lock.Lock()
73
+ partner.TaskDone(entry.Key)
74
tl.pQueue.Update(partner.Index())
75
tl.lock.Unlock()
76
},