diff options
author | Stephen Hines <srhines@google.com> | 2012-01-27 10:08:18 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-01-27 10:08:18 -0800 |
commit | cee905be4874f6d3f112527a53b0f7ff87655c66 (patch) | |
tree | b4da7acc008a4ede5aa5ca6a0ac7ce3b2bf4eb57 | |
parent | ef78d96b905f7b55cef5df7f5582a249a685458f (diff) | |
parent | e3f9cc67617ee55635c946efcff10fd920029b41 (diff) | |
download | frameworks_base-cee905be4874f6d3f112527a53b0f7ff87655c66.zip frameworks_base-cee905be4874f6d3f112527a53b0f7ff87655c66.tar.gz frameworks_base-cee905be4874f6d3f112527a53b0f7ff87655c66.tar.bz2 |
Merge "Don't wait forever if there are no commands to execute."
-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 8ba1a0e..1917774 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); } |