diff options
-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); } |