1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 02:30:39 +08:00

move taskdone inside lock boundaries

This commit is contained in:
Jeromy
2015-05-16 17:16:09 -07:00
committed by Juan Batiz-Benet
parent 32da687774
commit 65f815a27b

View File

@ -69,8 +69,8 @@ func (tl *prq) Push(entry wantlist.Entry, to peer.ID) {
Target: to,
created: time.Now(),
Done: func() {
partner.TaskDone(entry.Key)
tl.lock.Lock()
partner.TaskDone(entry.Key)
tl.pQueue.Update(partner.Index())
tl.lock.Unlock()
},