summaryrefslogtreecommitdiff
path: root/src/database/include/env_esp.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-04-27 12:55:30 +1000
committerjacqueline <me@jacqueline.id.au>2023-04-27 12:55:30 +1000
commit5d7cbec34cd5e473d5768b39054d99bc72ddad62 (patch)
treef83040e527dc025345b3786a298f11e914b5eb37 /src/database/include/env_esp.hpp
parentfbe047a35fff100cb5f42d10984bccde137f586e (diff)
downloadtangara-fw-5d7cbec34cd5e473d5768b39054d99bc72ddad62.tar.gz
Move DB interactions to a background thread
Diffstat (limited to 'src/database/include/env_esp.hpp')
-rw-r--r--src/database/include/env_esp.hpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/database/include/env_esp.hpp b/src/database/include/env_esp.hpp
index b8819b05..cf5a20e1 100644
--- a/src/database/include/env_esp.hpp
+++ b/src/database/include/env_esp.hpp
@@ -2,9 +2,8 @@
#include <mutex>
#include <set>
+#include <string>
-#include "freertos/FreeRTOS.h"
-#include "freertos/queue.h"
#include "leveldb/env.h"
#include "leveldb/status.h"
@@ -89,25 +88,6 @@ class EspEnv : public leveldb::Env {
void BackgroundThreadMain();
private:
- // Stores the work item data in a Schedule() call.
- //
- // Instances are constructed on the thread calling Schedule() and used on the
- // background thread.
- //
- // This structure is thread-safe beacuse it is immutable.
- struct BackgroundWorkItem {
- explicit BackgroundWorkItem(void (*f)(void*), void* a)
- : function(f), arg(a) {}
-
- void (*const function)(void*);
- void* const arg;
- };
-
- std::mutex background_work_mutex_;
- bool started_background_thread_;
-
- QueueHandle_t background_work_queue_;
-
InMemoryLockTable locks_; // Thread-safe.
};