Skip to content

Commit

Permalink
*: avoid using official atomic.Int64 (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhebox authored Jan 3, 2023
1 parent d774f31 commit da56a2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/util/security/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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() {
}
}

Expand Down

0 comments on commit da56a2c

Please sign in to comment.