()
| 185 | } |
| 186 | |
| 187 | func (bq *blockingQueue) dequeue() interface{} { |
| 188 | item := bq.items[bq.headIdx] |
| 189 | bq.items[bq.headIdx] = nil |
| 190 | |
| 191 | bq.headIdx++ |
| 192 | if bq.headIdx == len(bq.items) { |
| 193 | bq.headIdx = 0 |
| 194 | } |
| 195 | |
| 196 | bq.size-- |
| 197 | bq.isNotFull.Signal() |
| 198 | return item |
| 199 | } |
| 200 | |
| 201 | func (bq *blockingQueue) Size() int { |
| 202 | bq.mutex.Lock() |
no outgoing calls
no test coverage detected