SpiecsEngine
 
Loading...
Searching...
No Matches

◆ GetInst()

EventLoop *& Spices::Net::EventLoopThreadWrapper::GetInst ( InetAddress * address = nullptr)
static

Get EventLoop Instance. @reutrn Returns EventLoop Instance.

Thread Unique EventLoop.

Thread Unique EventLoop.

Definition at line 173 of file EventLoop.cpp.

174 {
176
180 static _declspec(thread) EventLoopThreadWrapper pTLSEventLoop;
181
182 if (!pTLSEventLoop.instance)
183 {
184 pTLSEventLoop.instance = new EventLoop(address);
185 }
186
187 return pTLSEventLoop.instance;
188 }
#define SPICES_PROFILE_ZONE
EventLoopThreadWrapper()
Constructor Function.
Definition EventLoop.h:186

References Spices::Net::EventLoop::EventLoop(), and instance.

Referenced by Spices::Net::EventLoopThreadPool::GetNextLoop(), Spices::Net::TcpServer::Start(), SpicesTest::TEST(), and SpicesTest::TEST().