| 2 | #include "EventLoop.h" |
| 3 | |
| 4 | EventLoopThread::EventLoopThread(const ThreadInitCallback &cb, |
| 5 | const std::string &name) |
| 6 | : loop_(nullptr) |
| 7 | , exiting_(false) |
| 8 | , thread_(std::bind(&EventLoopThread::threadFunc, this), name) // 新线程绑定此函数 |
| 9 | , mutex_() |
| 10 | , cond_() |
| 11 | , callback_(cb) // 传入的线程初始化回调函数,用户自定义的 |
| 12 | { |
| 13 | } |
| 14 | |
| 15 | EventLoopThread::~EventLoopThread() |
| 16 | { |
nothing calls this directly
no outgoing calls
no test coverage detected