()
| 217 | } |
| 218 | |
| 219 | func (c *context) Suspend() error { |
| 220 | c.cond.L.Lock() |
| 221 | defer c.cond.L.Unlock() |
| 222 | |
| 223 | if err := c.err.Load(); err != nil { |
| 224 | return err.(error) |
| 225 | } |
| 226 | c.toPause = true |
| 227 | c.toResume = false |
| 228 | c.cond.Signal() |
| 229 | return nil |
| 230 | } |
| 231 | |
| 232 | func (c *context) Resume() error { |
| 233 | c.cond.L.Lock() |