diff options
author | peterbell10 <peterbell10@live.co.uk> | 2018-07-22 23:35:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-22 23:35:58 +0200 |
commit | 7b431bed513db3318811698029304d81e5831ab3 (patch) | |
tree | a05eec7426d42f0d194f538292559e3da189c13d | |
parent | Make offline UUIDs consistent with vanilla. (#4178) (diff) | |
download | cuberite-7b431bed513db3318811698029304d81e5831ab3.tar cuberite-7b431bed513db3318811698029304d81e5831ab3.tar.gz cuberite-7b431bed513db3318811698029304d81e5831ab3.tar.bz2 cuberite-7b431bed513db3318811698029304d81e5831ab3.tar.lz cuberite-7b431bed513db3318811698029304d81e5831ab3.tar.xz cuberite-7b431bed513db3318811698029304d81e5831ab3.tar.zst cuberite-7b431bed513db3318811698029304d81e5831ab3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ChunkSender.cpp | 12 | ||||
-rw-r--r-- | src/ChunkSender.h | 2 | ||||
-rw-r--r-- | src/Generating/ChunkGenerator.cpp | 2 | ||||
-rw-r--r-- | src/LightingThread.cpp | 2 | ||||
-rw-r--r-- | src/OSSupport/IsThread.cpp | 10 | ||||
-rw-r--r-- | src/Protocol/Authenticator.cpp | 3 | ||||
-rw-r--r-- | src/WorldStorage/WorldStorage.cpp | 2 |
7 files changed, 7 insertions, 26 deletions
diff --git a/src/ChunkSender.cpp b/src/ChunkSender.cpp index 60f9d8c68..aa51ed4ed 100644 --- a/src/ChunkSender.cpp +++ b/src/ChunkSender.cpp @@ -79,21 +79,11 @@ cChunkSender::~cChunkSender() -bool cChunkSender::Start() -{ - m_ShouldTerminate = false; - return super::Start(); -} - - - - - void cChunkSender::Stop(void) { m_ShouldTerminate = true; m_evtQueue.Set(); - Wait(); + super::Stop(); } diff --git a/src/ChunkSender.h b/src/ChunkSender.h index a17dfcab2..c5702d7b3 100644 --- a/src/ChunkSender.h +++ b/src/ChunkSender.h @@ -67,8 +67,6 @@ public: }; - bool Start(); - void Stop(void); /** Queues a chunk to be sent to a specific client */ diff --git a/src/Generating/ChunkGenerator.cpp b/src/Generating/ChunkGenerator.cpp index e0fee5bd0..3ac128c46 100644 --- a/src/Generating/ChunkGenerator.cpp +++ b/src/Generating/ChunkGenerator.cpp @@ -98,7 +98,7 @@ void cChunkGenerator::Stop(void) m_ShouldTerminate = true; m_Event.Set(); m_evtRemoved.Set(); // Wake up anybody waiting for empty queue - Wait(); + super::Stop(); delete m_Generator; m_Generator = nullptr; diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index ccefdfef2..c83589965 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -140,7 +140,7 @@ void cLightingThread::Stop(void) m_ShouldTerminate = true; m_evtItemAdded.Set(); - Wait(); + super::Stop(); } diff --git a/src/OSSupport/IsThread.cpp b/src/OSSupport/IsThread.cpp index 3f75951ba..d60d0d9eb 100644 --- a/src/OSSupport/IsThread.cpp +++ b/src/OSSupport/IsThread.cpp @@ -60,8 +60,7 @@ cIsThread::cIsThread(const AString & a_ThreadName) : cIsThread::~cIsThread() { - m_ShouldTerminate = true; - Wait(); + Stop(); } @@ -110,14 +109,9 @@ bool cIsThread::Start(void) void cIsThread::Stop(void) { - if (!m_Thread.joinable()) - { - // The thread hasn't been started or has already been joined - return; - } - m_ShouldTerminate = true; Wait(); + m_ShouldTerminate = false; } diff --git a/src/Protocol/Authenticator.cpp b/src/Protocol/Authenticator.cpp index 445a3dff5..da4685635 100644 --- a/src/Protocol/Authenticator.cpp +++ b/src/Protocol/Authenticator.cpp @@ -77,7 +77,6 @@ void cAuthenticator::Authenticate(int a_ClientID, const AString & a_UserName, co void cAuthenticator::Start(cSettingsRepositoryInterface & a_Settings) { ReadSettings(a_Settings); - m_ShouldTerminate = false; super::Start(); } @@ -89,7 +88,7 @@ void cAuthenticator::Stop(void) { m_ShouldTerminate = true; m_QueueNonempty.Set(); - Wait(); + super::Stop(); } diff --git a/src/WorldStorage/WorldStorage.cpp b/src/WorldStorage/WorldStorage.cpp index 7be710c29..a3aff0749 100644 --- a/src/WorldStorage/WorldStorage.cpp +++ b/src/WorldStorage/WorldStorage.cpp @@ -94,7 +94,7 @@ void cWorldStorage::WaitForFinish(void) // Wait for the thread to finish: m_ShouldTerminate = true; m_Event.Set(); // Wake up the thread if waiting - super::Wait(); + super::Stop(); LOGD("World storage thread finished"); } |