Returns the next scan range from the queue. Returns nullptr if the queue is empty.
| 55 | |
| 56 | /// Returns the next scan range from the queue. Returns nullptr if the queue is empty. |
| 57 | io::ScanRange* Dequeue() { |
| 58 | io::ScanRange* ret = nullptr; |
| 59 | std::lock_guard<std::mutex> lock(scan_range_queue_lock_); |
| 60 | if (UNLIKELY(!high_prio_scan_ranges_.empty())) { |
| 61 | ret = high_prio_scan_ranges_.front(); |
| 62 | high_prio_scan_ranges_.pop(); |
| 63 | } else if (!scan_range_queue_.Empty()) { |
| 64 | ret = scan_range_queue_.Pop(); |
| 65 | } |
| 66 | return ret; |
| 67 | } |
| 68 | |
| 69 | /// Returns true if the scan range queue is empty. |
| 70 | bool Empty() { |
no test coverage detected