From: Ian Lance Taylor Date: Thu, 26 Mar 2020 16:13:11 +0000 (-0700) Subject: runtime: lock mtxpoll in AIX netpollBreak X-Git-Tag: go1.15beta1~731 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=78a45d8b4592dbd38057a2e9af83c9cf9d62ddc9;p=gostls13.git runtime: lock mtxpoll in AIX netpollBreak 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 --- diff --git a/src/runtime/netpoll_aix.go b/src/runtime/netpoll_aix.go index c936fbb70f..61becc247e 100644 --- a/src/runtime/netpoll_aix.go +++ b/src/runtime/netpoll_aix.go @@ -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.