diff --git a/src/runtime/lock_sema.go b/src/runtime/lock_sema.go index fcc531ce78c..b36c97f71e8 100644 --- a/src/runtime/lock_sema.go +++ b/src/runtime/lock_sema.go @@ -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) {