17#include <trantor/net/EventLoop.h>
19#include <trantor/exports.h>
23#include <condition_variable>
32class TRANTOR_EXPORT EventLoopThread : NonCopyable
35 explicit EventLoopThread(
const std::string &threadName =
"EventLoopThread");
63 std::shared_ptr<EventLoop> loop_;
64 std::mutex loopMutex_;
66 std::string loopThreadName_;
68 std::promise<std::shared_ptr<EventLoop>> promiseForLoopPointer_;
69 std::promise<int> promiseForRun_;
70 std::promise<int> promiseForLoop_;
void wait()
Wait for the event loop to exit.
EventLoop * getLoop() const
Get the pointer of the event loop of the thread.
Definition EventLoopThread.h:49
void run()
Run the event loop of the thread. This method doesn't block the current thread.
As the name implies, this class represents an event loop that runs in a particular thread....
Definition EventLoop.h:56
Definition EventLoop.h:34