psemek/libs/async/source/synchronous_executor.cpp

35 lines
585 B
C++

#include <psemek/async/synchronous_executor.hpp>
#include <stdexcept>
namespace psemek::async
{
void synchronous_executor::post(task t)
{
t();
}
void synchronous_executor::post_at(clock::time_point, task)
{
throw std::runtime_error("synchronous_executor doesn't support executor::post_at");
}
void synchronous_executor::stop()
{}
void synchronous_executor::wait()
{}
void synchronous_executor::wait_for(clock::duration)
{}
void synchronous_executor::wait_until(clock::time_point)
{}
std::size_t synchronous_executor::task_count() const
{
return 0;
}
}