Adds all scan ranges to the queue. If 'high_prio' is true we add it to a separate list of prioritized items.
| 41 | /// Adds all scan ranges to the queue. If 'high_prio' is true we add it to a separate |
| 42 | /// list of prioritized items. |
| 43 | void EnqueueRanges(const std::vector<io::ScanRange*>& ranges, bool high_prio) { |
| 44 | std::lock_guard<std::mutex> lock(scan_range_queue_lock_); |
| 45 | if (LIKELY(!high_prio)) { |
| 46 | for (io::ScanRange* scan_range : ranges) { |
| 47 | scan_range_queue_.Push(scan_range); |
| 48 | } |
| 49 | } else { |
| 50 | for (io::ScanRange* scan_range : ranges) { |
| 51 | high_prio_scan_ranges_.push(scan_range); |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | /// Returns the next scan range from the queue. Returns nullptr if the queue is empty. |
| 57 | io::ScanRange* Dequeue() { |
no test coverage detected