1
0
mirror of https://github.com/golang/go synced 2024-11-23 20:40:07 -07:00

runtime: call atomic.Storeuintptr in noteclear on AIX

The memory might not be synchronized in a thread being woken up after a
semasleep. Using atomic instructions in noteclear function will force
this synchronisation.

Fixes #30189

Change-Id: If7432f29b2a1a56288231822db52f3f8d1d6dbfe
Reviewed-on: https://go-review.googlesource.com/c/go/+/163624
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Clément Chigot 2019-02-25 09:44:33 +01:00 committed by Ian Lance Taylor
parent 46e03c4b92
commit 1956b28ae3

View File

@ -122,7 +122,13 @@ func unlock(l *mutex) {
// One-time notifications.
func noteclear(n *note) {
n.key = 0
if GOOS == "aix" {
// On AIX, semaphores might not synchronize the memory in some
// rare cases. See issue #30189.
atomic.Storeuintptr(&n.key, 0)
} else {
n.key = 0
}
}
func notewakeup(n *note) {