SpiecsEngine
 
Loading...
Searching...
No Matches

◆ GetNextLoop()

EventLoop * Spices::Net::EventLoopThreadPool::GetNextLoop ( )

Get next thread EventLoop.

Returns
Returns Next Thread EventLoop.

Definition at line 14 of file EventLoopThreadPool.cpp.

15 {
17
18 EventLoop* loop = EventLoopThreadWrapper::GetInst();
19
20 if (!m_Loops.empty())
21 {
22 loop = m_Loops[m_Next];
23 ++m_Next;
24
25 if (m_Next >= m_Loops.size())
26 {
27 m_Next = 0;
28 }
29 }
30
31 return loop;
32 }
#define SPICES_PROFILE_ZONE
std::vector< EventLoop * > m_Loops
All threads EventLoop collection.
static EventLoop *& GetInst(InetAddress *address=nullptr)
Get EventLoop Instance. @reutrn Returns EventLoop Instance.

References Spices::Net::EventLoopThreadWrapper::GetInst(), and m_Next.