vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
synchronous_executor.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/concurrency/completion_notifier.hpp>
6#include <vitrio/concurrency/executor.hpp>
7#include <vitrio/concurrency/task.hpp>
8#include <vitrio/export.hpp>
9
10#include <memory>
11
12namespace vitrio
13{
14
23class VITRIO_API synchronous_executor final
24 : public executor
25{
26public:
27 synchronous_executor() noexcept;
28
29 synchronous_executor(const synchronous_executor &other) = delete;
31
32 ~synchronous_executor() override;
33
35 operator=(const synchronous_executor &other) = delete;
37 operator=(synchronous_executor &&other) = delete;
38
46 void submit(
47 std::unique_ptr<task> t,
48 std::shared_ptr<completion_notifier> notifier
49 ) override;
50};
51
52} // namespace vitrio
Where a task is handed off to run, now or later.
Definition executor.hpp:26
An executor that runs a task on the calling thread, before submit returns.
Definition synchronous_executor.hpp:25
void submit(std::unique_ptr< task > t, std::shared_ptr< completion_notifier > notifier) override
Run a unit of work immediately, on the calling thread.