20#include <condition_variable>
37template <
typename T,
typename... Params>
39 const Params&... params) {
40 return makeSafeCallback<T>(obj,
41 [f, params...](T* me) { (me->*f)(params...); });
44template <
typename T,
typename... Params>
46 const Params&... params) {
47 return makeSafeCallback<T>(obj,
48 [f, params...](T* me) { (me->*f)(params...); });
72 std::chrono::steady_clock::time_point
when;
Definition: thread_looper.h:51
bool stopped_
Definition: thread_looper.h:79
void ThreadLoop()
Definition: thread_looper.cpp:83
void Stop()
Definition: thread_looper.cpp:114
void Insert(const Event &event)
Definition: thread_looper.cpp:71
std::mutex lock_
Definition: thread_looper.h:82
std::condition_variable cond_
Definition: thread_looper.h:83
std::function< void()> Callback
Definition: thread_looper.h:59
ThreadLooper()
Definition: thread_looper.cpp:22
bool CancelSerial(Serial serial)
Definition: thread_looper.cpp:54
ThreadLooper & operator=(const ThreadLooper &)=delete
std::thread looper_thread_
Definition: thread_looper.h:80
~ThreadLooper()
Definition: thread_looper.cpp:26
std::deque< Event > queue_
Definition: thread_looper.h:84
ThreadLooper(const ThreadLooper &)=delete
Serial Post(Callback cb)
Definition: thread_looper.cpp:32
int32_t Serial
Definition: thread_looper.h:60
std::atomic< Serial > next_serial_
Definition: thread_looper.h:85
static const char * serial
Definition: fastboot.cpp:96
Event event
Definition: kernel_log_server.cc:59
Definition: alloc_driver.h:20
std::function< void()> makeSafeCallback(T *me, std::function< void(T *)> f)
Definition: thread_looper.h:29
Definition: thread_looper.h:71
Callback cb
Definition: thread_looper.h:73
bool operator<=(const Event &other) const
Definition: thread_looper.cpp:28
std::chrono::steady_clock::time_point when
Definition: thread_looper.h:72
Serial serial
Definition: thread_looper.h:74