mirror of
https://github.com/containers/podman.git
synced 2025-11-29 17:48:05 +08:00
fix(deps): update module github.com/vbauerster/mpb/v8 to v8.9.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
56
vendor/github.com/vbauerster/mpb/v8/heap_manager.go
generated
vendored
56
vendor/github.com/vbauerster/mpb/v8/heap_manager.go
generated
vendored
@@ -10,7 +10,6 @@ const (
|
||||
h_sync heapCmd = iota
|
||||
h_push
|
||||
h_iter
|
||||
h_drain
|
||||
h_fix
|
||||
h_state
|
||||
h_end
|
||||
@@ -22,8 +21,9 @@ type heapRequest struct {
|
||||
}
|
||||
|
||||
type iterData struct {
|
||||
iter chan<- *Bar
|
||||
drop <-chan struct{}
|
||||
drop <-chan struct{}
|
||||
iter chan<- *Bar
|
||||
iterPop chan<- *Bar
|
||||
}
|
||||
|
||||
type pushData struct {
|
||||
@@ -41,7 +41,7 @@ func (m heapManager) run() {
|
||||
var bHeap priorityQueue
|
||||
var pMatrix, aMatrix map[int][]chan int
|
||||
|
||||
var l int
|
||||
var len int
|
||||
var sync bool
|
||||
|
||||
for req := range m {
|
||||
@@ -49,11 +49,9 @@ func (m heapManager) run() {
|
||||
case h_push:
|
||||
data := req.data.(pushData)
|
||||
heap.Push(&bHeap, data.bar)
|
||||
if !sync {
|
||||
sync = data.sync
|
||||
}
|
||||
sync = sync || data.sync
|
||||
case h_sync:
|
||||
if sync || l != bHeap.Len() {
|
||||
if sync || len != bHeap.Len() {
|
||||
pMatrix = make(map[int][]chan int)
|
||||
aMatrix = make(map[int][]chan int)
|
||||
for _, b := range bHeap {
|
||||
@@ -66,33 +64,37 @@ func (m heapManager) run() {
|
||||
}
|
||||
}
|
||||
sync = false
|
||||
l = bHeap.Len()
|
||||
len = bHeap.Len()
|
||||
}
|
||||
drop := req.data.(<-chan struct{})
|
||||
syncWidth(pMatrix, drop)
|
||||
syncWidth(aMatrix, drop)
|
||||
case h_iter:
|
||||
data := req.data.(iterData)
|
||||
drop_iter:
|
||||
loop: // unordered iteration
|
||||
for _, b := range bHeap {
|
||||
select {
|
||||
case data.iter <- b:
|
||||
case <-data.drop:
|
||||
break drop_iter
|
||||
data.iterPop = nil
|
||||
break loop
|
||||
}
|
||||
}
|
||||
close(data.iter)
|
||||
case h_drain:
|
||||
data := req.data.(iterData)
|
||||
drop_drain:
|
||||
if data.iterPop == nil {
|
||||
break
|
||||
}
|
||||
loop_pop: // ordered iteration
|
||||
for bHeap.Len() != 0 {
|
||||
bar := heap.Pop(&bHeap).(*Bar)
|
||||
select {
|
||||
case data.iter <- heap.Pop(&bHeap).(*Bar):
|
||||
case data.iterPop <- bar:
|
||||
case <-data.drop:
|
||||
break drop_drain
|
||||
heap.Push(&bHeap, bar)
|
||||
break loop_pop
|
||||
}
|
||||
}
|
||||
close(data.iter)
|
||||
close(data.iterPop)
|
||||
case h_fix:
|
||||
data := req.data.(fixData)
|
||||
if data.bar.index < 0 {
|
||||
@@ -104,7 +106,7 @@ func (m heapManager) run() {
|
||||
}
|
||||
case h_state:
|
||||
ch := req.data.(chan<- bool)
|
||||
ch <- sync || l != bHeap.Len()
|
||||
ch <- sync || len != bHeap.Len()
|
||||
case h_end:
|
||||
ch := req.data.(chan<- interface{})
|
||||
if ch != nil {
|
||||
@@ -123,19 +125,21 @@ func (m heapManager) sync(drop <-chan struct{}) {
|
||||
|
||||
func (m heapManager) push(b *Bar, sync bool) {
|
||||
data := pushData{b, sync}
|
||||
m <- heapRequest{cmd: h_push, data: data}
|
||||
req := heapRequest{cmd: h_push, data: data}
|
||||
select {
|
||||
case m <- req:
|
||||
default:
|
||||
go func() {
|
||||
m <- req
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
func (m heapManager) iter(iter chan<- *Bar, drop <-chan struct{}) {
|
||||
data := iterData{iter, drop}
|
||||
func (m heapManager) iter(drop <-chan struct{}, iter, iterPop chan<- *Bar) {
|
||||
data := iterData{drop, iter, iterPop}
|
||||
m <- heapRequest{cmd: h_iter, data: data}
|
||||
}
|
||||
|
||||
func (m heapManager) drain(iter chan<- *Bar, drop <-chan struct{}) {
|
||||
data := iterData{iter, drop}
|
||||
m <- heapRequest{cmd: h_drain, data: data}
|
||||
}
|
||||
|
||||
func (m heapManager) fix(b *Bar, priority int, lazy bool) {
|
||||
data := fixData{b, priority, lazy}
|
||||
m <- heapRequest{cmd: h_fix, data: data}
|
||||
|
||||
Reference in New Issue
Block a user