mirror of
https://github.com/glest/glest-source.git
synced 2025-08-17 21:51:17 +02:00
- attempt to make TOM happy, clickl madly while game is loading and help lame windows not choke
This commit is contained in:
@@ -155,4 +155,38 @@ bool SimpleTaskThread::getTaskSignalled() {
|
||||
return retval;
|
||||
}
|
||||
|
||||
PumpSDLEventsTaskThread::PumpSDLEventsTaskThread() : BaseThread() {
|
||||
}
|
||||
|
||||
void PumpSDLEventsTaskThread::execute() {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
setRunningStatus(true);
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"SDL_PumpEvents thread is running\n");
|
||||
|
||||
try {
|
||||
unsigned int idx = 0;
|
||||
for(;getQuitStatus() == false;) {
|
||||
SDL_PumpEvents();
|
||||
sleep(100);
|
||||
}
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
}
|
||||
catch(const exception &ex) {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] error [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
|
||||
setRunningStatus(false);
|
||||
}
|
||||
catch(...) {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] unknown error\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
setRunningStatus(false);
|
||||
}
|
||||
|
||||
setRunningStatus(false);
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"SDL_PumpEvents thread is exiting\n");
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
}}//end namespace
|
||||
|
@@ -19,6 +19,15 @@ namespace Shared{ namespace Platform{
|
||||
// =====================================
|
||||
// Threads
|
||||
// =====================================
|
||||
Thread::Thread() {
|
||||
thread = NULL;
|
||||
}
|
||||
|
||||
Thread::~Thread() {
|
||||
if(thread != NULL) {
|
||||
SDL_WaitThread(thread, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void Thread::start() {
|
||||
thread = SDL_CreateThread(beginExecution, this);
|
||||
|
Reference in New Issue
Block a user