Merge "Don't wait forever if there are no commands to execute."

This commit is contained in:
Stephen Hines
2012-01-27 10:08:18 -08:00
committed by Android (Google) Code Review

View File

@@ -124,7 +124,6 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand, uint64_t time
while (!mToCore.isEmpty() || waitForCommand) { while (!mToCore.isEmpty() || waitForCommand) {
uint32_t cmdID = 0; uint32_t cmdID = 0;
uint32_t cmdSize = 0; uint32_t cmdSize = 0;
ret = true;
if (con->props.mLogTimes) { if (con->props.mLogTimes) {
con->timerSet(Context::RS_TIMER_IDLE); con->timerSet(Context::RS_TIMER_IDLE);
} }
@@ -136,11 +135,17 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand, uint64_t time
delay = 0; delay = 0;
} }
} }
if (delay == 0 && timeToWait != 0 && mToCore.isEmpty()) {
break;
}
const void * data = mToCore.get(&cmdID, &cmdSize, delay); const void * data = mToCore.get(&cmdID, &cmdSize, delay);
if (!cmdSize) { if (!cmdSize) {
// exception or timeout occurred. // exception or timeout occurred.
return false; break;
} }
ret = true;
if (con->props.mLogTimes) { if (con->props.mLogTimes) {
con->timerSet(Context::RS_TIMER_INTERNAL); con->timerSet(Context::RS_TIMER_INTERNAL);
} }