diff options
Diffstat (limited to 'src/runtime/stack.go')
| -rw-r--r-- | src/runtime/stack.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go index 2a7f0bd1c3..0bfa9320e0 100644 --- a/src/runtime/stack.go +++ b/src/runtime/stack.go @@ -886,7 +886,7 @@ func copystack(gp *g, newsize uintptr) { // Adjust sudogs, synchronizing with channel ops if necessary. ncopy := used if !gp.activeStackChans { - if newsize < old.hi-old.lo && atomic.Load8(&gp.parkingOnChan) != 0 { + if newsize < old.hi-old.lo && gp.parkingOnChan.Load() { // It's not safe for someone to shrink this stack while we're actively // parking on a channel, but it is safe to grow since we do that // ourselves and explicitly don't want to synchronize with channels @@ -1150,7 +1150,7 @@ func isShrinkStackSafe(gp *g) bool { // We also can't *shrink* the stack in the window between the // goroutine calling gopark to park on a channel and // gp.activeStackChans being set. - return gp.syscallsp == 0 && !gp.asyncSafePoint && atomic.Load8(&gp.parkingOnChan) == 0 + return gp.syscallsp == 0 && !gp.asyncSafePoint && !gp.parkingOnChan.Load() } // Maybe shrink the stack being used by gp. |
