]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: lock mtxpoll in AIX netpollBreak
authorIan Lance Taylor <iant@golang.org>
Thu, 26 Mar 2020 16:13:11 +0000 (09:13 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 27 Mar 2020 20:29:31 +0000 (20:29 +0000)
netpollBreak calls netpollwakeup, and netpollwakeup expects the mtxpoll
lock to be held, so that it has exclusive access to pendingUpdates.
Not acquiring the lock was a mistake in CL 171824. Fortunately it
rarely matters in practice.

Change-Id: I32962ec2575c846ef3d6a91a4d821b2ff02d983c
Reviewed-on: https://go-review.googlesource.com/c/go/+/225618
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/netpoll_aix.go

index c936fbb70f75a011394523d63708d0b1df7c2d41..61becc247ec9cde5a886dda853de22ebb44f91b6 100644 (file)
@@ -130,7 +130,9 @@ func netpollarm(pd *pollDesc, mode int) {
 
 // netpollBreak interrupts a poll.
 func netpollBreak() {
+       lock(&mtxpoll)
        netpollwakeup()
+       unlock(&mtxpoll)
 }
 
 // netpoll checks for ready network connections.