Browse Source

解决BucketPool关闭之后Pool内有些数据未消费的问题

feature_wq
Sydonian 8 months ago
parent
commit
94506dcdff
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      utils/sync2/bucket_pool.go

+ 5
- 5
utils/sync2/bucket_pool.go View File

@@ -52,12 +52,12 @@ func (p *BucketPool[T]) GetFilled() (T, bool) {
p.filledCond.L.Lock() p.filledCond.L.Lock()
defer p.filledCond.L.Unlock() defer p.filledCond.L.Unlock()


if p.closed {
var t T
return t, false
}

if len(p.filled) == 0 { if len(p.filled) == 0 {
if p.closed {
var t T
return t, false
}

p.filledCond.Wait() p.filledCond.Wait()
} }




Loading…
Cancel
Save