1 Star 0 Fork 1

王布衣 / pkg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
composite_barrier.go 433 Bytes
一键复制 编辑 原始数据 按行查看 历史
package fastqueue
import "math"
type compositeBarrier []*Cursor
func NewCompositeBarrier(sequences ...*Cursor) Barrier {
if len(sequences) == 1 {
return sequences[0]
} else {
return compositeBarrier(sequences)
}
}
func (this compositeBarrier) Load() int64 {
var minimum int64 = math.MaxInt64
for _, item := range this {
if sequence := item.Load(); sequence < minimum {
minimum = sequence
}
}
return minimum
}
1
https://gitee.com/quant1x/pkg.git
git@gitee.com:quant1x/pkg.git
quant1x
pkg
pkg
v0.2.8

搜索帮助