aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/netpoll_aix.go
diff options
context:
space:
mode:
authorAndy Pan <panjf2000@gmail.com>2020-04-10 10:45:58 +0800
committerIan Lance Taylor <iant@golang.org>2020-04-10 03:29:25 +0000
commit245409ea86f20fd9f4167223c2339fb238f9e4b6 (patch)
tree6b4f600a7131c14eb3e0611177d020e69346fc54 /src/runtime/netpoll_aix.go
parent7b90c1c0c42099248fbb849e8a1c3251984688ac (diff)
downloadgo-245409ea86f20fd9f4167223c2339fb238f9e4b6.tar.gz
go-245409ea86f20fd9f4167223c2339fb238f9e4b6.zip
runtime: replace the type of netpollWakeSig from a uintptr to a uint32
There's no need for netpollWakeSig to use a uintptr type, a uint32 is enough. Relevant CL: CL 212737 Change-Id: Ide24478b217a02bad62f7e000a9680c26a8c5366 Reviewed-on: https://go-review.googlesource.com/c/go/+/227798 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
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 3c1f70874d..4590ed81a6 100644
--- a/src/runtime/netpoll_aix.go
+++ b/src/runtime/netpoll_aix.go
@@ -45,7 +45,7 @@ var (
wrwake int32
pendingUpdates int32
- netpollWakeSig uintptr // used to avoid duplicate calls of netpollBreak
+ netpollWakeSig uint32 // used to avoid duplicate calls of netpollBreak
)
func netpollinit() {
@@ -135,7 +135,7 @@ func netpollarm(pd *pollDesc, mode int) {
// netpollBreak interrupts a poll.
func netpollBreak() {
- if atomic.Casuintptr(&netpollWakeSig, 0, 1) {
+ if atomic.Cas(&netpollWakeSig, 0, 1) {
b := [1]byte{0}
write(uintptr(wrwake), unsafe.Pointer(&b[0]), 1)
}
@@ -192,7 +192,7 @@ retry:
var b [1]byte
for read(rdwake, unsafe.Pointer(&b[0]), 1) == 1 {
}
- atomic.Storeuintptr(&netpollWakeSig, 0)
+ atomic.Store(&netpollWakeSig, 0)
}
// Still look at the other fds even if the mode may have
// changed, as netpollBreak might have been called.