drainWait blocks the caller until all Pushes on this queue are complete.
()
| 59 | |
| 60 | // drainWait blocks the caller until all Pushes on this queue are complete. |
| 61 | func (q *queue) drainWait() { |
| 62 | for atomic.LoadUint32(&q.acquired) != atomic.LoadUint32(&q.written) { |
| 63 | runtime.Gosched() |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | // A queuePair has two queues. At any given time, Pushes go into the queue |
| 68 | // referenced by queuePair.q. The active queue gets switched when there's a |