diff --git a/cartographer/sensor/ordered_multi_queue.h b/cartographer/sensor/ordered_multi_queue.h index fc4e313..321c84b 100644 --- a/cartographer/sensor/ordered_multi_queue.h +++ b/cartographer/sensor/ordered_multi_queue.h @@ -50,15 +50,19 @@ inline std::ostream& operator<<(std::ostream& out, const QueueKey& key) { } // Maintains multiple queues of sorted sensor data and dispatches it in merge -// sorted order. This class is thread-compatible. +// sorted order. It will wait to see at least one value for each unfinished queue before +// dispatching the next time ordered value across all queues. This class is thread-compatible. class OrderedMultiQueue { public: using Callback = std::function)>; - // Will wait to see at least one value for each unfinished queue before - // dispatching the next smallest value across all queues. OrderedMultiQueue() {} - ~OrderedMultiQueue() {} + + ~OrderedMultiQueue() { + for (auto& entry : queues_) { + CHECK(entry.second.finished); + } + } void AddQueue(const QueueKey& queue_key, Callback callback) { CHECK(FindOrNull(queue_key) == nullptr);