From d44880dfa99197a8c1f4b65416470e6ffbe534f6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 17 Oct 2013 21:34:36 +0200 Subject: UpdateGlue: handle update id management Add UpdateQueueItem::id to keep track of the id in every item. Replaces thhe hack in update_queue_push(). --- src/UpdateQueue.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/UpdateQueue.cxx') diff --git a/src/UpdateQueue.cxx b/src/UpdateQueue.cxx index aa6074c7f..2a30e5d5f 100644 --- a/src/UpdateQueue.cxx +++ b/src/UpdateQueue.cxx @@ -27,14 +27,14 @@ static constexpr unsigned MAX_UPDATE_QUEUE_SIZE = 32; static std::queue> update_queue; -unsigned -update_queue_push(const char *path, bool discard, unsigned base) +bool +update_queue_push(const char *path, bool discard, unsigned id) { if (update_queue.size() >= MAX_UPDATE_QUEUE_SIZE) - return 0; + return false; - update_queue.emplace(path, discard); - return base + update_queue.size(); + update_queue.emplace(path, discard, id); + return true; } UpdateQueueItem -- cgit v1.2.3