SpiecsEngine
 
Loading...
Searching...
No Matches

◆ QueueInLoop()

void Spices::Net::EventLoop::QueueInLoop ( Functor cb)

Execute functor in EventLoop thread.

Parameters
[in]cbFunctor.

Definition at line 91 of file EventLoop.cpp.

92 {
93 {
94 std::unique_lock<std::mutex> lock(m_Mutex);
95 m_PendingFunctors.emplace_back(cb);
96 }
97
99 {
100 WakeUp();
101 }
102 }
std::vector< Functor > m_PendingFunctors
Delay functors.
Definition EventLoop.h:168
std::atomic_bool m_IsCallingPendingFunctors
True if is execute pending functors.
Definition EventLoop.h:138
std::mutex m_Mutex
Mutex for PendingFunctors.
Definition EventLoop.h:173
void WakeUp()
WakeUp a thread, which wait on recv, by sending one byte data.
bool IsInLoopThread() const
Determine if current thread is in eventloop thread.
Definition EventLoop.h:109

References WakeUp().