aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/netpoll_aix.go
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2022-08-17 16:18:07 +0700
committerCuong Manh Le <cuong.manhle.vn@gmail.com>2022-08-17 17:39:31 +0000
commitce7aae5095c9f0c5ed2e4daddeac25a415cc370c (patch)
treeb84ebdbafc8314ce64f99b603547c2c2f8b802e3 /src/runtime/netpoll_aix.go
parent901b9233e6eadc7b5235d4bb492c6b04f75cab9a (diff)
downloadgo-ce7aae5095c9f0c5ed2e4daddeac25a415cc370c.tar.gz
go-ce7aae5095c9f0c5ed2e4daddeac25a415cc370c.zip
runtime: convert aix netpollWakeSig to atomic type
Updates #53821 Change-Id: Ic073871ed2638ca22e6cb057dd8297f27582e78f Reviewed-on: https://go-review.googlesource.com/c/go/+/423877 Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/runtime/netpoll_aix.go')
-rw-r--r--src/runtime/netpoll_aix.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/netpoll_aix.go b/src/runtime/netpoll_aix.go
index 5247e56373..5184aad421 100644
--- a/src/runtime/netpoll_aix.go
+++ b/src/runtime/netpoll_aix.go
@@ -45,7 +45,7 @@ var (
wrwake int32
pendingUpdates int32
- netpollWakeSig uint32 // used to avoid duplicate calls of netpollBreak
+ netpollWakeSig atomic.Uint32 // used to avoid duplicate calls of netpollBreak
)
func netpollinit() {
@@ -136,7 +136,7 @@ func netpollarm(pd *pollDesc, mode int) {
// netpollBreak interrupts a poll.
func netpollBreak() {
// Failing to cas indicates there is an in-flight wakeup, so we're done here.
- if !atomic.Cas(&netpollWakeSig, 0, 1) {
+ if !netpollWakeSig.CompareAndSwap(0, 1) {
return
}
@@ -196,7 +196,7 @@ retry:
var b [1]byte
for read(rdwake, unsafe.Pointer(&b[0]), 1) == 1 {
}
- atomic.Store(&netpollWakeSig, 0)
+ netpollWakeSig.Store(0)
}
// Still look at the other fds even if the mode may have
// changed, as netpollBreak might have been called.