aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/stack.go')
-rw-r--r--src/runtime/stack.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go
index 00cd6aeb1d..8f31c936be 100644
--- a/src/runtime/stack.go
+++ b/src/runtime/stack.go
@@ -719,6 +719,10 @@ func copystack(gp *g, newsize uintptr) {
print("copystack gp=", gp, " [", hex(old.lo), " ", hex(old.hi-used), " ", hex(old.hi), "]/", gp.stackAlloc, " -> [", hex(new.lo), " ", hex(new.hi-used), " ", hex(new.hi), "]/", newsize, "\n")
}
+ // Disallow sigprof scans of this stack and block if there's
+ // one in progress.
+ gcLockStackBarriers(gp)
+
// adjust pointers in the to-be-copied frames
var adjinfo adjustinfo
adjinfo.old = old
@@ -751,6 +755,8 @@ func copystack(gp *g, newsize uintptr) {
gp.stkbar = newstkbar
gp.stktopsp += adjinfo.delta
+ gcUnlockStackBarriers(gp)
+
// free old stack
if stackPoisonCopy != 0 {
fillstack(old, 0xfc)