- sound system is now threaded by default (hopefully this fixes buffer underruns errors from openal)

- background music now plays when game is loading
This commit is contained in:
Mark Vejvoda
2011-01-18 01:24:45 +00:00
parent 9ba8668751
commit d16f6a93bc
8 changed files with 54 additions and 12 deletions

View File

@@ -85,6 +85,18 @@ SimpleTaskThread::SimpleTaskThread( SimpleTaskCallbackInterface *simpleTaskInter
this->millisecsBetweenExecutions = millisecsBetweenExecutions;
this->needTaskSignal = needTaskSignal;
setTaskSignalled(false);
MutexSafeWrapper safeMutex(&mutexLastExecuteTimestamp);
lastExecuteTimestamp = time(NULL);
}
bool SimpleTaskThread::isThreadExecutionLagging() {
bool result = false;
MutexSafeWrapper safeMutex(&mutexLastExecuteTimestamp);
result = (difftime(time(NULL),lastExecuteTimestamp) >= 5.0);
safeMutex.ReleaseLock();
return result;
}
bool SimpleTaskThread::canShutdown(bool deleteSelfIfShutdownDelayed) {
@@ -124,8 +136,12 @@ void SimpleTaskThread::execute() {
else if(runTask == true) {
//SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] uniqueID [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->getUniqueID().c_str());
if(getQuitStatus() == false) {
ExecutingTaskSafeWrapper safeExecutingTaskMutex(this);
ExecutingTaskSafeWrapper safeExecutingTaskMutex(this);
this->simpleTaskInterface->simpleTask(this);
MutexSafeWrapper safeMutex(&mutexLastExecuteTimestamp);
lastExecuteTimestamp = time(NULL);
safeMutex.ReleaseLock();
}
//SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] uniqueID [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->getUniqueID().c_str());
}