aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack1.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/stack1.go')
-rw-r--r--src/runtime/stack1.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/stack1.go b/src/runtime/stack1.go
index efcb5f25fa..19634ef6d5 100644
--- a/src/runtime/stack1.go
+++ b/src/runtime/stack1.go
@@ -609,6 +609,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
@@ -640,6 +644,8 @@ func copystack(gp *g, newsize uintptr) {
gp.stackAlloc = newsize
gp.stkbar = newstkbar
+ gcUnlockStackBarriers(gp)
+
// free old stack
if stackPoisonCopy != 0 {
fillstack(old, 0xfc)