diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go index 567c567000da28..34d0627fcbfe58 100644 --- a/src/runtime/os_windows.go +++ b/src/runtime/os_windows.go @@ -277,13 +277,11 @@ func monitorSuspendResume() { return // Running on Windows 7, where we don't need it anyway. } var fn interface{} = func(context uintptr, changeType uint32, setting uintptr) uintptr { - lock(&allglock) - for _, gp := range allgs { - if gp.m != nil && gp.m.resumesema != 0 { - stdcall1(_SetEvent, gp.m.resumesema) + for mp := (*m)(atomic.Loadp(unsafe.Pointer(&allm))); mp != nil; mp = mp.alllink { + if mp.resumesema != 0 { + stdcall1(_SetEvent, mp.resumesema) } } - unlock(&allglock) return 0 } params := _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS{