diff options
author | Mattes D <github@xoft.cz> | 2015-02-18 22:41:22 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-02-18 22:41:22 +0100 |
commit | 70d54054e332c05d94e69b1eeca45a8773115c14 (patch) | |
tree | 91489591bea80cabc3dd4dd66a06531506354418 /src/OSSupport/NetworkSingleton.cpp | |
parent | InfoReg: Fixed MultiCommand return values. (diff) | |
download | cuberite-70d54054e332c05d94e69b1eeca45a8773115c14.tar cuberite-70d54054e332c05d94e69b1eeca45a8773115c14.tar.gz cuberite-70d54054e332c05d94e69b1eeca45a8773115c14.tar.bz2 cuberite-70d54054e332c05d94e69b1eeca45a8773115c14.tar.lz cuberite-70d54054e332c05d94e69b1eeca45a8773115c14.tar.xz cuberite-70d54054e332c05d94e69b1eeca45a8773115c14.tar.zst cuberite-70d54054e332c05d94e69b1eeca45a8773115c14.zip |
Diffstat (limited to '')
-rw-r--r-- | src/OSSupport/NetworkSingleton.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/OSSupport/NetworkSingleton.cpp b/src/OSSupport/NetworkSingleton.cpp index 000b17641..358e24438 100644 --- a/src/OSSupport/NetworkSingleton.cpp +++ b/src/OSSupport/NetworkSingleton.cpp @@ -63,8 +63,7 @@ cNetworkSingleton::cNetworkSingleton(void): } // Create the event loop thread: - std::thread EventLoopThread(RunEventLoop, this); - EventLoopThread.detach(); + m_EventLoopThread = std::thread(RunEventLoop, this); } @@ -98,7 +97,7 @@ void cNetworkSingleton::Terminate(void) // Wait for the LibEvent event loop to terminate: event_base_loopbreak(m_EventBase); - m_EventLoopTerminated.Wait(); + m_EventLoopThread.join(); // Remove all objects: { @@ -143,7 +142,6 @@ void cNetworkSingleton::LogCallback(int a_Severity, const char * a_Msg) void cNetworkSingleton::RunEventLoop(cNetworkSingleton * a_Self) { event_base_loop(a_Self->m_EventBase, EVLOOP_NO_EXIT_ON_EMPTY); - a_Self->m_EventLoopTerminated.Set(); } |