diff options
author | Max Kellermann <max@duempel.org> | 2014-01-29 20:16:43 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-30 18:47:05 +0100 |
commit | c6725884bc155da431889468c86c546f0f64f9a1 (patch) | |
tree | 61d89751ecc98db9600620ac1788f32dea9214e1 /src/db/update/Queue.cxx | |
parent | a31738f6f1473f4f621bc16513ed0c6024749389 (diff) | |
download | mpd-c6725884bc155da431889468c86c546f0f64f9a1.tar.gz mpd-c6725884bc155da431889468c86c546f0f64f9a1.tar.xz mpd-c6725884bc155da431889468c86c546f0f64f9a1.zip |
db/update: convert to OO API
Move global variables into the new classes. That may allow multiple
update threads for multiple databases one day.
Diffstat (limited to '')
-rw-r--r-- | src/db/update/Queue.cxx (renamed from src/db/update/UpdateQueue.cxx) | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/db/update/UpdateQueue.cxx b/src/db/update/Queue.cxx index a6002f854..4bb0ae725 100644 --- a/src/db/update/UpdateQueue.cxx +++ b/src/db/update/Queue.cxx @@ -18,17 +18,10 @@ */ #include "config.h" -#include "UpdateQueue.hxx" - -#include <queue> -#include <list> - -static constexpr unsigned MAX_UPDATE_QUEUE_SIZE = 32; - -static std::queue<UpdateQueueItem, std::list<UpdateQueueItem>> update_queue; +#include "Queue.hxx" bool -update_queue_push(const char *path, bool discard, unsigned id) +UpdateQueue::Push(const char *path, bool discard, unsigned id) { if (update_queue.size() >= MAX_UPDATE_QUEUE_SIZE) return false; @@ -38,7 +31,7 @@ update_queue_push(const char *path, bool discard, unsigned id) } UpdateQueueItem -update_queue_shift() +UpdateQueue::Pop() { if (update_queue.empty()) return UpdateQueueItem(); |