20 const std::function<
void()> &,
const std::string &);
27 std::rethrow_exception(
m_exptr);
35 std::function<void()>
m_fn;
43 m_exptr = std::current_exception();
57std::unique_ptr<LambdaThread>
runInThread(
const std::function<
void()> &fn,
58 const std::string &thread_name =
"")
60 std::unique_ptr<LambdaThread> t(
new LambdaThread(thread_name));
Class returned by runInThread.
Definition lambda.h:18
friend std::unique_ptr< LambdaThread > runInThread(const std::function< void()> &, const std::string &)
Run a lambda in a separate thread.
Definition lambda.h:57
void * run()
Definition lambda.h:38
LambdaThread(const std::string &name="")
Definition lambda.h:32
std::exception_ptr m_exptr
Definition lambda.h:36
std::function< void()> m_fn
Definition lambda.h:35
void rethrow()
Re-throw a caught exception, if any. Can only be called after thread exit.
Definition lambda.h:23
bool isRunning()
Definition thread.h:91
bool start()
Definition thread.cpp:109
#define sanity_check(expr)
Definition debug.h:56
std::unique_ptr< LambdaThread > runInThread(const std::function< void()> &fn, const std::string &thread_name="")
Run a lambda in a separate thread.
Definition lambda.h:57