diff options
author | Mattes D <github@xoft.cz> | 2015-01-09 11:20:19 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-01-22 20:12:41 +0100 |
commit | b8b3409b74e93dd7d1e87f60f498c724e5374f26 (patch) | |
tree | aa8544f87dabc26e4b4cab1c130051035e6c00c3 /src/OSSupport/Network.cpp | |
parent | Implemented LibEvent-based client connections. (diff) | |
download | cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar.gz cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar.bz2 cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar.lz cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar.xz cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.tar.zst cuberite-b8b3409b74e93dd7d1e87f60f498c724e5374f26.zip |
Diffstat (limited to 'src/OSSupport/Network.cpp')
-rw-r--r-- | src/OSSupport/Network.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/OSSupport/Network.cpp b/src/OSSupport/Network.cpp index d947bfa90..0e19e40de 100644 --- a/src/OSSupport/Network.cpp +++ b/src/OSSupport/Network.cpp @@ -358,8 +358,8 @@ protected: /** Converts LibEvent-generated log events into log messages in MCS log. */ static void LogCallback(int a_Severity, const char * a_Msg); - /** Runs the thread that LibEvent uses to dispatch event. */ - static void EventLoopThread(cNetworkSingleton * a_Self); + /** Implements the thread that runs LibEvent's event dispatcher loop. */ + static void RunEventLoop(cNetworkSingleton * a_Self); }; @@ -722,7 +722,8 @@ cNetworkSingleton::cNetworkSingleton(void) } // Create the event loop thread: - std::thread::thread(EventLoopThread, this).detach(); + std::thread EventLoopThread(RunEventLoop, this); + EventLoopThread.detach(); } @@ -827,7 +828,7 @@ void cNetworkSingleton::LogCallback(int a_Severity, const char * a_Msg) -void cNetworkSingleton::EventLoopThread(cNetworkSingleton * a_Self) +void cNetworkSingleton::RunEventLoop(cNetworkSingleton * a_Self) { event_base_loop(a_Self->m_EventBase, EVLOOP_NO_EXIT_ON_EMPTY); } |