Replace spins with proper pthread conditions.

This commit is contained in:
Jason Sams
2009-06-18 16:58:42 -07:00
parent f8cd5d9988
commit 5f7fc27dce
5 changed files with 112 additions and 24 deletions

View File

@@ -34,16 +34,17 @@ ThreadIO::~ThreadIO()
{
}
bool ThreadIO::playCoreCommands(Context *con)
bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand)
{
//LOGE("playCoreCommands 1");
uint32_t cmdID = 0;
uint32_t cmdSize = 0;
bool ret = false;
while(!mToCore.isEmpty()) {
while(!mToCore.isEmpty() || waitForCommand) {
ret = true;
//LOGE("playCoreCommands 2");
const void * data = mToCore.get(&cmdID, &cmdSize);
waitForCommand = false;
//LOGE("playCoreCommands 3 %i %i", cmdID, cmdSize);
gPlaybackFuncs[cmdID](con, data);