init allows a recvBuffer to be initialized in-place, which is useful for resetting a buffer or for avoiding a heap allocation when the buffer is embedded in another struct.
()
| 78 | // for resetting a buffer or for avoiding a heap allocation when the buffer |
| 79 | // is embedded in another struct. |
| 80 | func (b *recvBuffer) init() { |
| 81 | b.c = make(chan recvMsg, 1) |
| 82 | } |
| 83 | |
| 84 | func (b *recvBuffer) put(r recvMsg) { |
| 85 | b.mu.Lock() |
no outgoing calls