(bufPool *bufferPool)
| 113 | } |
| 114 | |
| 115 | func newPipeWriter(bufPool *bufferPool) (*pipeReader, *pipeWriter) { |
| 116 | p := &pipe{ |
| 117 | cond: sync.NewCond(new(sync.Mutex)), |
| 118 | bufPool: bufPool, |
| 119 | buf: nil, |
| 120 | } |
| 121 | return &pipeReader{ |
| 122 | pipe: p, |
| 123 | }, &pipeWriter{ |
| 124 | pipe: p, |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | // Read implements the standard Read interface: it reads data from the pipe, |
| 129 | // reading from the internal buffer, otherwise blocking until a writer arrives |