Skip to content

Commit

Permalink
feat: implement grpc client side sync pieces (#1167)
Browse files Browse the repository at this point in the history
* feat: implement grpc client side sync pieces

Signed-off-by: Jim Ma <[email protected]>

* fix: client unit test

Signed-off-by: Jim Ma <[email protected]>

* chore: report sync piece error

Signed-off-by: Jim Ma <[email protected]>

* chore: optimize pieceTaskSyncManager cancel

Signed-off-by: Jim Ma <[email protected]>
  • Loading branch information
jim3ma authored Mar 23, 2022
1 parent 3f30dc2 commit 7d44095
Show file tree
Hide file tree
Showing 8 changed files with 1,493 additions and 237 deletions.
5 changes: 5 additions & 0 deletions client/daemon/peer/peertask_bitmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func (b *Bitmap) Set(i int32) {
b.bits[i/8] |= 1 << uint(7-i%8)
}

func (b *Bitmap) Clean(i int32) {
b.settled.Dec()
b.bits[i/8] ^= 1 << uint(7-i%8)
}

func (b *Bitmap) Settled() int32 {
return b.settled.Load()
}
Expand Down
Loading

0 comments on commit 7d44095

Please sign in to comment.