diff options
author | 2012-01-26 17:09:43 -0800 | |
---|---|---|
committer | 2012-01-26 17:32:09 -0800 | |
commit | e3f9cc67617ee55635c946efcff10fd920029b41 (patch) | |
tree | f0ccdb1cc8cf7221c72182dd1936d89976ef6a76 /libs/rs/rsThreadIO.cpp | |
parent | 109116bb2f751d84a9ce89ac40c45e76c0aa462c (diff) |
Don't wait forever if there are no commands to execute.
BUG=5614887
This fixes a timing issue where we could calculate a delay of 0 (indicating
wait forever) when we have no pending commands to actually execute. In such
cases, we should just break out of the playback loop.
This also fixes a small issue with returning whether or not to redraw.
Change-Id: Id1e481679341773256b7287062c68925e2bc8f9e
Diffstat (limited to 'libs/rs/rsThreadIO.cpp')
-rw-r--r-- | libs/rs/rsThreadIO.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/rs/rsThreadIO.cpp b/libs/rs/rsThreadIO.cpp index 8ba1a0e4294d..191777428712 100644 --- a/libs/rs/rsThreadIO.cpp +++ b/libs/rs/rsThreadIO.cpp @@ -124,7 +124,6 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand, uint64_t time while (!mToCore.isEmpty() || waitForCommand) { uint32_t cmdID = 0; uint32_t cmdSize = 0; - ret = true; if (con->props.mLogTimes) { con->timerSet(Context::RS_TIMER_IDLE); } @@ -136,11 +135,17 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand, uint64_t time delay = 0; } } + + if (delay == 0 && timeToWait != 0 && mToCore.isEmpty()) { + break; + } + const void * data = mToCore.get(&cmdID, &cmdSize, delay); if (!cmdSize) { // exception or timeout occurred. - return false; + break; } + ret = true; if (con->props.mLogTimes) { con->timerSet(Context::RS_TIMER_INTERNAL); } |