From 78a45d8b4592dbd38057a2e9af83c9cf9d62ddc9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 26 Mar 2020 09:13:11 -0700 Subject: [PATCH] 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 --- src/runtime/netpoll_aix.go | 2 ++ 1 file changed, 2 insertions(+) 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. -- 2.50.0