summaryrefslogtreecommitdiff
path: root/src/database/include/database.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-05-22 15:23:51 +1000
committerjacqueline <me@jacqueline.id.au>2023-05-22 15:23:51 +1000
commit5ac4d3949cd7430e0d4c994bbc528e8e4fa91337 (patch)
treedcd30c252e45afa20f084e1a58cbabd861ca299c /src/database/include/database.hpp
parentb320a6a863cf1c10dc79254af41f573730935564 (diff)
downloadtangara-fw-5ac4d3949cd7430e0d4c994bbc528e8e4fa91337.tar.gz
Generalise worker tasks, and centralise task priorities + stacks
Includes making the display driver use a worker task for flushes, so that our double buffering actually does something useful /facepalm
Diffstat (limited to 'src/database/include/database.hpp')
-rw-r--r--src/database/include/database.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/database/include/database.hpp b/src/database/include/database.hpp
index da0ed083..ce2ca9fe 100644
--- a/src/database/include/database.hpp
+++ b/src/database/include/database.hpp
@@ -19,6 +19,7 @@
#include "result.hpp"
#include "song.hpp"
#include "tag_parser.hpp"
+#include "tasks.hpp"
namespace database {
@@ -90,6 +91,8 @@ class Database {
leveldb::DB* db_;
leveldb::Cache* cache_;
+ std::shared_ptr<tasks::Worker> worker_task_;
+
// Not owned.
IFileGatherer* file_gatherer_;
ITagParser* tag_parser_;
@@ -97,7 +100,8 @@ class Database {
Database(leveldb::DB* db,
leveldb::Cache* cache,
IFileGatherer* file_gatherer,
- ITagParser* tag_parser);
+ ITagParser* tag_parser,
+ std::shared_ptr<tasks::Worker> worker);
auto dbMintNewSongId() -> SongId;
auto dbEntomb(SongId song, uint64_t hash) -> void;