1
0

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
This commit is contained in:
faketruth 2012-08-19 16:57:22 +00:00
parent 8560ceeef5
commit 5b36aa1567

View File

@ -77,9 +77,6 @@ cRoot::~cRoot()
void cRoot::InputThread(void * a_Params) void cRoot::InputThread(void * a_Params)
{ {
#if defined(ANDROID_NDK)
return;
#else
cRoot & self = *(cRoot*)a_Params; cRoot & self = *(cRoot*)a_Params;
while (!(self.m_bStop || self.m_bRestart)) while (!(self.m_bStop || self.m_bRestart))
@ -88,7 +85,6 @@ void cRoot::InputThread(void * a_Params)
std::getline(std::cin, Command); std::getline(std::cin, Command);
self.ServerCommand(Command); self.ServerCommand(Command);
} }
#endif
} }
@ -159,9 +155,11 @@ void cRoot::Start()
m_Server->StartListenThread(); m_Server->StartListenThread();
//cHeartBeat* HeartBeat = new cHeartBeat(); //cHeartBeat* HeartBeat = new cHeartBeat();
#if !defined(ANDROID_NDK)
LOG("Starting InputThread..."); LOG("Starting InputThread...");
m_InputThread = new cThread( InputThread, this, "cRoot::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 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."); LOG("Initialization done, server running now.");
while( !m_bStop && !m_bRestart ) // These are modified by external threads while( !m_bStop && !m_bRestart ) // These are modified by external threads
@ -169,7 +167,9 @@ void cRoot::Start()
cSleep::MilliSleep( 1000 ); cSleep::MilliSleep( 1000 );
} }
#if !defined(ANDROID_NDK)
delete m_InputThread; m_InputThread = 0; delete m_InputThread; m_InputThread = 0;
#endif
// Deallocate stuffs // Deallocate stuffs
LOG("Shutting down server..."); LOG("Shutting down server...");