From 66b445471b1e85f77a40d9f426ac5e8e4baa8de8 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Tue, 20 Oct 2020 17:01:49 +0300 Subject: fix memory reordering in the tests?? --- static_pool_test.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'static_pool_test.go') diff --git a/static_pool_test.go b/static_pool_test.go index fd8124ac..e986a9bf 100644 --- a/static_pool_test.go +++ b/static_pool_test.go @@ -8,6 +8,7 @@ import ( "runtime" "strconv" "sync" + "sync/atomic" "testing" "time" @@ -173,6 +174,8 @@ func Test_StaticPool_Broken_Replace(t *testing.T) { wg := &sync.WaitGroup{} wg.Add(1) + var i int64 + atomic.StoreInt64(&i, 10) go func() { for { -- cgit v1.2.3