51 #include <condition_variable> 53 #include "../error/kallisto_error.hpp" 93 std::vector<std::thread> m_threads;
95 std::condition_variable m_threads_cv;
98 std::queue<ExecutorRunnable> m_runnable_queue;
100 std::mutex m_runnable_queue_mutex;
103 std::atomic<bool> m_running;
110 void run(
unsigned int i);
115 Executor(Executor
const&) =
delete;
116 Executor(Executor&&) =
delete;
117 void operator=(Executor
const&) =
delete;
118 void operator=(Executor &&) =
delete;
127 Executor(std::string tag,
unsigned int nr_threads);
139 error::KallistoDetailedResult
execute(ExecutorRunnable runnable);
147 error::KallistoDetailedResult
shutdown();
168 #endif // EXECUTOR_HPP static const unsigned int MINIMUM_NUMBER_THREADS
Definition: executor.hpp:81
error::KallistoDetailedResult shutdown()
Definition: bluetooth_adapter.hpp:52
static const unsigned int MAXIMUM_NUMBER_THREADS
Definition: executor.hpp:76
std::function< void()> ExecutorRunnable
Definition: executor.hpp:86
error::KallistoDetailedResult shutdownNow()
error::KallistoDetailedResult execute(ExecutorRunnable runnable)