mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: document sudog
Change-Id: I85c0bcf02842cc32dbc9bfdcea27efe871173574 Reviewed-on: https://go-review.googlesource.com/20774 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
ac74e5debc
commit
857d0b48db
1 changed files with 10 additions and 0 deletions
|
|
@ -210,6 +210,16 @@ type gobuf struct {
|
|||
bp uintptr // for GOEXPERIMENT=framepointer
|
||||
}
|
||||
|
||||
// sudog represents a g in a wait list, such as for sending/receiving
|
||||
// on a channel.
|
||||
//
|
||||
// sudog is necessary because the g ↔ synchronization object relation
|
||||
// is many-to-many. A g can be on many wait lists, so there may be
|
||||
// many sudogs for one g; and many gs may be waiting on the same
|
||||
// synchronization object, so there may be many sudogs for one object.
|
||||
//
|
||||
// sudogs are allocated from a special pool. Use acquireSudog and
|
||||
// releaseSudog to allocate and free them.
|
||||
type sudog struct {
|
||||
// The following fields are protected by the hchan.lock of the
|
||||
// channel this sudog is blocking on. shrinkstack depends on
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue