From da56a2cf1ed96d4b508642a19162b0558973b45f Mon Sep 17 00:00:00 2001 From: xhe Date: Tue, 3 Jan 2023 21:44:16 +0800 Subject: [PATCH] *: avoid using official atomic.Int64 (#169) --- lib/util/security/cert.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util/security/cert.go b/lib/util/security/cert.go index c7300a36..ccd4ab3f 100644 --- a/lib/util/security/cert.go +++ b/lib/util/security/cert.go @@ -19,11 +19,11 @@ import ( "crypto/x509" "encoding/pem" "os" - "sync/atomic" "time" "github.com/pingcap/TiProxy/lib/config" "github.com/pingcap/TiProxy/lib/util/errors" + "go.uber.org/atomic" "go.uber.org/zap" ) @@ -126,7 +126,7 @@ func (ci *CertInfo) verifyPeerCertificate(rawCerts [][]byte, _ [][]*x509.Certifi } func (ci *CertInfo) updateMinExpire(n int64) { - for o := ci.expire.Load(); o > n && !ci.expire.CompareAndSwap(o, n); o = ci.expire.Load() { + for o := ci.expire.Load(); o > n && !ci.expire.CAS(o, n); o = ci.expire.Load() { } }