Throttle low priority RS threads by sleeping once per frame to avoid starving other apps.
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index 073d98b..f11b862 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/rsScriptC.cpp
@@ -60,7 +60,7 @@
}
-bool ScriptC::run(Context *rsc, uint32_t launchIndex)
+uint32_t ScriptC::run(Context *rsc, uint32_t launchIndex)
{
Context::ScriptTLSStruct * tls =
(Context::ScriptTLSStruct *)pthread_getspecific(Context::gThreadTLSKey);
@@ -85,9 +85,9 @@
}
setupScript();
- bool ret = false;
+ uint32_t ret = 0;
tls->mScript = this;
- ret = mProgram.mScript(launchIndex) != 0;
+ ret = mProgram.mScript(launchIndex);
tls->mScript = NULL;
return ret;
}