diff options
Diffstat (limited to 'src/runtime/runtime2.go')
| -rw-r--r-- | src/runtime/runtime2.go | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 5d7f4354ef..eda258a992 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -214,11 +214,18 @@ type gobuf struct { // Changes here must also be made in src/cmd/compile/internal/gc/select.go's // selecttype. type sudog struct { - g *g - selectdone *uint32 // CAS to 1 to win select race (may point to stack) - next *sudog - prev *sudog - elem unsafe.Pointer // data element (may point to stack) + // The following fields are protected by the hchan.lock of the + // channel this sudog is blocking on. + + g *g + selectdone *uint32 // CAS to 1 to win select race (may point to stack) + next *sudog + prev *sudog + elem unsafe.Pointer // data element (may point to stack) + + // The following fields are never accessed concurrently. + // waitlink is only accessed by g. + releasetime int64 ticket uint32 waitlink *sudog // g.waiting list |
