#include "thread/executor.h" #include #include namespace threading { void SameThreadExecutor::Run(std::function func) { func(); } void NewThreadExecutor::Run(std::function func) { thread_ = std::thread(func); } NewThreadExecutor::~NewThreadExecutor() { // If Run was ever called... if (thread_.joinable()) thread_.join(); } } // namespace threading