(data []byte)
| 146 | } |
| 147 | |
| 148 | func (b *PtyBuffer) writeData(data []byte) { |
| 149 | b.CVar.L.Lock() |
| 150 | defer b.CVar.L.Unlock() |
| 151 | // only wait if buffer is currently over max size, otherwise allow this append to go through |
| 152 | for b.DataBuf.Len() > MaxBufferedDataSize { |
| 153 | b.CVar.Wait() |
| 154 | } |
| 155 | b.DataBuf.Write(data) |
| 156 | b.CVar.Broadcast() |
| 157 | } |
| 158 | |
| 159 | func (b *PtyBuffer) Read(p []byte) (n int, err error) { |
| 160 | b.CVar.L.Lock() |
no test coverage detected