Enqueue the request context to the disk queue.
| 76 | |
| 77 | /// Enqueue the request context to the disk queue. |
| 78 | void EnqueueContext(RequestContext* worker) { |
| 79 | { |
| 80 | std::unique_lock<std::mutex> disk_lock(lock_); |
| 81 | // Check that the reader is not already on the queue |
| 82 | DCHECK(find(request_contexts_.begin(), request_contexts_.end(), worker) == |
| 83 | request_contexts_.end()); |
| 84 | request_contexts_.push_back(worker); |
| 85 | } |
| 86 | work_available_.NotifyAll(); |
| 87 | } |
| 88 | |
| 89 | /// Signals that disk threads for this queue should stop processing new work and |
| 90 | /// terminate once done. |