This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type hchan struct { | |
qcount uint // total data in the queue | |
dataqsiz uint // size of the circular queue | |
buf unsafe.Pointer // points to an array of dataqsiz elements | |
elemsize uint16 | |
closed uint32 | |
elemtype *_type // element type | |
sendx uint // send index | |
recvx uint // receive index | |
recvq waitq // list of recv waiters | |
sendq waitq // list of send waiters | |
// lock protects all fields in hchan, as well as several | |
// fields in sudogs blocked on this channel. | |
// | |
// Do not change another G's status while holding this lock | |
// (in particular, do not ready a G), as this can deadlock | |
// with stack shrinking. | |
lock mutex | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment