diff options
author | Max Kellermann <max@duempel.org> | 2013-10-17 21:34:36 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-17 21:45:53 +0200 |
commit | d44880dfa99197a8c1f4b65416470e6ffbe534f6 (patch) | |
tree | d1f0fdf941adb11802c8b7ae8811b707c3ac5794 /src/UpdateQueue.cxx | |
parent | 0c63632cc2354e662da67453043a039efb65ae28 (diff) | |
download | mpd-d44880dfa99197a8c1f4b65416470e6ffbe534f6.tar.gz mpd-d44880dfa99197a8c1f4b65416470e6ffbe534f6.tar.xz mpd-d44880dfa99197a8c1f4b65416470e6ffbe534f6.zip |
UpdateGlue: handle update id management
Add UpdateQueueItem::id to keep track of the id in every item.
Replaces thhe hack in update_queue_push().
Diffstat (limited to 'src/UpdateQueue.cxx')
-rw-r--r-- | src/UpdateQueue.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
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<UpdateQueueItem, std::list<UpdateQueueItem>> 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 |