Lines Matching defs:pipe
16 type pipe struct { struct
17 mu sync.Mutex
18 c sync.Cond // c.L lazily initialized to &p.mu
19 b pipeBuffer // nil when done reading
20 err error // read error once empty. non-nil means closed.
21 breakErr error // immediate read error (caller doesn't see rest of b)
22 donec chan struct{} // closed on error
23 readFn func() // optional code to run in Read before error
32 func (p *pipe) Len() int {
43 func (p *pipe) Read(d []byte) (n int, err error) {
72 func (p *pipe) Write(d []byte) (n int, err error) {
93 func (p *pipe) CloseWithError(err error) { p.closeWithError(&p.err, err, nil) }
98 func (p *pipe) BreakWithError(err error) { p.closeWithError(&p.breakErr, err, nil) }
102 func (p *pipe) closeWithErrorAndCode(err error, fn func()) { p.closeWithError(&p.err, err, fn) }
104 func (p *pipe) closeWithError(dst *error, err error, fn func()) {
127 func (p *pipe) closeDoneLocked() {
141 func (p *pipe) Err() error {
152 func (p *pipe) Done() <-chan struct{} {