Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed Feb 1, 2023
1 parent 0ed473b commit 837a6d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/gpool/spmc/spmcpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (p *Pool[T, U, C, CT, TF]) Tune(size int) {
p.capacity.Store(int32(size))
if size > capacity {
for i := 0; i < size-capacity; i++ {
if tid, boostTask := p.taskManager.Overclock(capacity); boostTask != nil {
if tid, boostTask := p.taskManager.Overclock(size); boostTask != nil {
p.addWaitingTask()
newTask := boostTask.Clone()
p.taskManager.AddSubTask(tid, newTask)
Expand All @@ -159,7 +159,7 @@ func (p *Pool[T, U, C, CT, TF]) Tune(size int) {
return
}
if size < capacity {
p.taskManager.Downclock(capacity)
p.taskManager.Downclock(size)
}
}

Expand Down

0 comments on commit 837a6d0

Please sign in to comment.