summaryrefslogtreecommitdiff
path: root/rsThreadIO.cpp
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-06-18 16:58:42 -0700
committerJason Sams <rjsams@android.com>2009-06-18 16:58:42 -0700
commit732f1c0a29cc468ea271ca3bd654239a0a973fd5 (patch)
tree5969f6c165fe56ca8704fd9fe0b33014af12792d /rsThreadIO.cpp
parent8ce125be69531dbf3a7e856d5e59d1b8e2789db0 (diff)
downloadrs-732f1c0a29cc468ea271ca3bd654239a0a973fd5.tar.gz
Replace spins with proper pthread conditions.
Diffstat (limited to 'rsThreadIO.cpp')
-rw-r--r--rsThreadIO.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/rsThreadIO.cpp b/rsThreadIO.cpp
index 23c808a6..56415819 100644
--- a/rsThreadIO.cpp
+++ b/rsThreadIO.cpp
@@ -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);