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
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 {
40 func (p *pipe) Read(d []byte) (n int, err error) {
68 func (p *pipe) Write(d []byte) (n int, err error) {
86 func (p *pipe) CloseWithError(err error) { p.closeWithError(&p.err, err, nil) }
91 func (p *pipe) BreakWithError(err error) { p.closeWithError(&p.breakErr, err, nil) }
95 func (p *pipe) closeWithErrorAndCode(err error, fn func()) { p.closeWithError(&p.err, err, fn) }
97 func (p *pipe) closeWithError(dst *error, err error, fn func()) {
117 func (p *pipe) closeDoneLocked() {
131 func (p *pipe) Err() error {
142 func (p *pipe) Done() <-chan struct{} {