all: Use new Go 1.19 atomic types (#8772)

This commit is contained in:
greatroar
2023-02-07 12:07:34 +01:00
committed by GitHub
parent 882b711958
commit 38f2b34d29
19 changed files with 94 additions and 121 deletions

View File

@@ -108,13 +108,13 @@ func TestStressBufferPool(t *testing.T) {
default:
}
t.Log(bp.puts, bp.skips, bp.misses, bp.hits)
if bp.puts == 0 || bp.skips == 0 || bp.misses == 0 {
t.Log(bp.puts.Load(), bp.skips.Load(), bp.misses.Load(), bp.hits)
if bp.puts.Load() == 0 || bp.skips.Load() == 0 || bp.misses.Load() == 0 {
t.Error("didn't exercise some paths")
}
var hits int64
for _, h := range bp.hits {
hits += h
for i := range bp.hits {
hits += bp.hits[i].Load()
}
if hits == 0 {
t.Error("didn't exercise some paths")