summaryrefslogtreecommitdiff
path: root/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorBrian Colonna <bcolonna@google.com>2012-04-27 13:14:22 -0400
committerBrian Colonna <bcolonna@google.com>2012-04-30 13:32:39 -0400
commit257f2ecc97d294e95b069547466d2054926d960f (patch)
tree040ea954a0aaf185744f4ceb3b71869c64eeadd3 /graphics/java/android/renderscript/ProgramFragmentFixedFunction.java
parent6bc75916401ba85efd19a09a834f4c91cdd8c7f5 (diff)
Fix 6395288: Added lock to avoid unbind race condition
If turning the power off while FUL was closing (due to a timeout or a cancel for example), it would be possible for unbind() to get called twice due to a race condition. Turning the phone off calls unbind() from the UI thread, while the other close comes from a binder thread since it is coming from the service. PATCH SET 1 attempted to solve the problem by adding a lock, but having a lock around the bind is a bit scary. PATCH SET 2 takes a new approach by having all calls coming from a binder thread to be sent as messages to be handled on the UI thread. Having all events occur on the UI thread removes the possibility of race conditions and makes the code stronger by making everything happen in a deterministic order. This commit also cleans up the logcat logging a bit. A couple of the log messages are now printing without DEBUG being set to true. This is by no means spamming the log and they of course are only logged when FUL is being used. But it serves to give us some meaningful information from bug reports that are currently showing nothing. The statements that are now logged would have made this particular bug easy to track down. Change-Id: I25a65c0808d88cb941439e5bf1f989dba8608be4
Diffstat (limited to 'graphics/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions