From 5ac4d3949cd7430e0d4c994bbc528e8e4fa91337 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Mon, 22 May 2023 15:23:51 +1000 Subject: 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 --- src/database/include/db_task.hpp | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/database/include/db_task.hpp (limited to 'src/database/include/db_task.hpp') diff --git a/src/database/include/db_task.hpp b/src/database/include/db_task.hpp deleted file mode 100644 index 39f932b0..00000000 --- a/src/database/include/db_task.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace database { - -auto StartDbTask() -> bool; -auto QuitDbTask() -> void; - -auto SendToDbTask(std::function fn) -> void; - -template -auto RunOnDbTask(std::function fn) -> std::future { - std::shared_ptr> promise = - std::make_shared>(); - SendToDbTask([=]() { promise->set_value(std::invoke(fn)); }); - return promise->get_future(); -} - -template <> -auto RunOnDbTask(std::function fn) -> std::future; - -} // namespace database -- cgit v1.2.3