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.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go
index d809820b07..55e97e77af 100644
--- a/src/runtime/stack.go
+++ b/src/runtime/stack.go
@@ -821,7 +821,8 @@ func adjustsudogs(gp *g, adjinfo *adjustinfo) {
// the data elements pointed to by a SudoG structure
// might be in the stack.
for s := gp.waiting; s != nil; s = s.waitlink {
- adjustpointer(adjinfo, unsafe.Pointer(&s.elem))
+ adjustpointer(adjinfo, unsafe.Pointer(&s.elem.vu))
+ adjustpointer(adjinfo, unsafe.Pointer(&s.elem.vp))
}
}
@@ -834,7 +835,7 @@ func fillstack(stk stack, b byte) {
func findsghi(gp *g, stk stack) uintptr {
var sghi uintptr
for sg := gp.waiting; sg != nil; sg = sg.waitlink {
- p := uintptr(sg.elem) + uintptr(sg.c.elemsize)
+ p := sg.elem.uintptr() + uintptr(sg.c.get().elemsize)
if stk.lo <= p && p < stk.hi && p > sghi {
sghi = p
}
@@ -853,7 +854,7 @@ func syncadjustsudogs(gp *g, used uintptr, adjinfo *adjustinfo) uintptr {
// Lock channels to prevent concurrent send/receive.
var lastc *hchan
for sg := gp.waiting; sg != nil; sg = sg.waitlink {
- if sg.c != lastc {
+ if sg.c.get() != lastc {
// There is a ranking cycle here between gscan bit and
// hchan locks. Normally, we only allow acquiring hchan
// locks and then getting a gscan bit. In this case, we
@@ -863,9 +864,9 @@ func syncadjustsudogs(gp *g, used uintptr, adjinfo *adjustinfo) uintptr {
// suspended. So, we get a special hchan lock rank here
// that is lower than gscan, but doesn't allow acquiring
// any other locks other than hchan.
- lockWithRank(&sg.c.lock, lockRankHchanLeaf)
+ lockWithRank(&sg.c.get().lock, lockRankHchanLeaf)
}
- lastc = sg.c
+ lastc = sg.c.get()
}
// Adjust sudogs.
@@ -885,10 +886,10 @@ func syncadjustsudogs(gp *g, used uintptr, adjinfo *adjustinfo) uintptr {
// Unlock channels.
lastc = nil
for sg := gp.waiting; sg != nil; sg = sg.waitlink {
- if sg.c != lastc {
- unlock(&sg.c.lock)
+ if sg.c.get() != lastc {
+ unlock(&sg.c.get().lock)
}
- lastc = sg.c
+ lastc = sg.c.get()
}
return sgsize