summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
authorFabian Stein <fenstein12@googlemail.com>2017-01-01 22:43:24 +0100
committerMattes D <github@xoft.cz>2017-01-01 22:43:24 +0100
commitad476e1cf9c0bc5d6daf9286e264e37744332fbf (patch)
tree565dbf5922b5a3e80ecb898088e03cd6062e140f /src/Root.cpp
parentDisabled anticheat (#3511) (diff)
downloadcuberite-ad476e1cf9c0bc5d6daf9286e264e37744332fbf.tar
cuberite-ad476e1cf9c0bc5d6daf9286e264e37744332fbf.tar.gz
cuberite-ad476e1cf9c0bc5d6daf9286e264e37744332fbf.tar.bz2
cuberite-ad476e1cf9c0bc5d6daf9286e264e37744332fbf.tar.lz
cuberite-ad476e1cf9c0bc5d6daf9286e264e37744332fbf.tar.xz
cuberite-ad476e1cf9c0bc5d6daf9286e264e37744332fbf.tar.zst
cuberite-ad476e1cf9c0bc5d6daf9286e264e37744332fbf.zip
Diffstat (limited to 'src/Root.cpp')
-rw-r--r--src/Root.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Root.cpp b/src/Root.cpp
index 2a00c5cfa..3d3930975 100644
--- a/src/Root.cpp
+++ b/src/Root.cpp
@@ -304,11 +304,14 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo)
m_InputThread.join();
}
#else
- if (pthread_kill(m_InputThread.native_handle(), SIGKILL) != 0)
+ if (m_InputThread.get_id() != std::thread::id())
{
- LOGWARN("Couldn't notify the input thread; the server will hang before shutdown!");
- m_TerminateEventRaised = true;
- m_InputThread.detach();
+ if (pthread_kill(m_InputThread.native_handle(), SIGKILL) != 0)
+ {
+ LOGWARN("Couldn't notify the input thread; the server will hang before shutdown!");
+ m_TerminateEventRaised = true;
+ m_InputThread.detach();
+ }
}
#endif