Discard discards a chunk. It will be removed from the queue, available for allocation, and can be added and returned via Next() again. If the chunk is not already in the queue this does nothing, to avoid it being allocated to multiple fetchers.
(index uint32)
| 145 | // be added and returned via Next() again. If the chunk is not already in the queue this does |
| 146 | // nothing, to avoid it being allocated to multiple fetchers. |
| 147 | func (q *chunkQueue) Discard(index uint32) error { |
| 148 | q.Lock() |
| 149 | defer q.Unlock() |
| 150 | return q.discard(index) |
| 151 | } |
| 152 | |
| 153 | // discard discards a chunk, scheduling it for refetching. The caller must hold the mutex lock. |
| 154 | func (q *chunkQueue) discard(index uint32) error { |