db/update/Queue: use std::list instead of std::queue

The problem with std::queue is that it doesn't give us enough control.
The method Clear() is a kludge already, but soon, we'll need
filtering.
This commit is contained in:
Max Kellermann
2014-02-27 19:15:01 +01:00
parent d64edb6896
commit f65254680a
2 changed files with 4 additions and 5 deletions

View File

@@ -23,7 +23,6 @@
#include "check.h"
#include <string>
#include <queue>
#include <list>
struct UpdateQueueItem {
@@ -44,7 +43,7 @@ struct UpdateQueueItem {
class UpdateQueue {
static constexpr unsigned MAX_UPDATE_QUEUE_SIZE = 32;
std::queue<UpdateQueueItem, std::list<UpdateQueueItem>> update_queue;
std::list<UpdateQueueItem> update_queue;
public:
bool Push(const char *path, bool discard, unsigned id);
@@ -52,7 +51,7 @@ public:
UpdateQueueItem Pop();
void Clear() {
update_queue = decltype(update_queue)();
update_queue.clear();
}
};