vitrio 0.3.1
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;
30 synchronous_executor(synchronous_executor &&other) = delete;
31
32 ~synchronous_executor() override;
33
34 synchronous_executor&
35 operator=(const synchronous_executor &other) = delete;
36 synchronous_executor&
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
void submit(std::unique_ptr< task > t, std::shared_ptr< completion_notifier > notifier) override
Run a unit of work immediately, on the calling thread.