From 5b36aa1567f1af9f9ddebd924d4d870fc5075b6a Mon Sep 17 00:00:00 2001 From: faketruth Date: Sun, 19 Aug 2012 16:57:22 +0000 Subject: Android: Do not create an input thread for Android git-svn-id: http://mc-server.googlecode.com/svn/trunk@760 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cRoot.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/cRoot.cpp b/source/cRoot.cpp index 643b4105b..0d6ff8369 100644 --- a/source/cRoot.cpp +++ b/source/cRoot.cpp @@ -77,9 +77,6 @@ cRoot::~cRoot() void cRoot::InputThread(void * a_Params) { -#if defined(ANDROID_NDK) - return; -#else cRoot & self = *(cRoot*)a_Params; while (!(self.m_bStop || self.m_bRestart)) @@ -88,7 +85,6 @@ void cRoot::InputThread(void * a_Params) std::getline(std::cin, Command); self.ServerCommand(Command); } -#endif } @@ -159,9 +155,11 @@ void cRoot::Start() m_Server->StartListenThread(); //cHeartBeat* HeartBeat = new cHeartBeat(); +#if !defined(ANDROID_NDK) LOG("Starting InputThread..."); m_InputThread = new cThread( InputThread, this, "cRoot::InputThread" ); m_InputThread->Start( false ); //we should NOT wait? Otherwise we canīt stop the server from other threads than the input thread +#endif LOG("Initialization done, server running now."); while( !m_bStop && !m_bRestart ) // These are modified by external threads @@ -169,7 +167,9 @@ void cRoot::Start() cSleep::MilliSleep( 1000 ); } +#if !defined(ANDROID_NDK) delete m_InputThread; m_InputThread = 0; +#endif // Deallocate stuffs LOG("Shutting down server..."); -- cgit v1.2.3