summaryrefslogtreecommitdiffstats
path: root/libs/gui/SurfaceTexture.cpp
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-10-05 14:34:21 -0700
committerJesse Hall <jessehall@google.com>2012-10-05 14:40:50 -0700
commit9504eb915c9628e130f45019bdefda0168089886 (patch)
tree1f571cdd5e5e20b674ecc666a2f107ac7949b9a6 /libs/gui/SurfaceTexture.cpp
parent0e8fcc2c27f278478483ebbe1befe1460e8bbed1 (diff)
downloadframeworks_native-9504eb915c9628e130f45019bdefda0168089886.zip
frameworks_native-9504eb915c9628e130f45019bdefda0168089886.tar.gz
frameworks_native-9504eb915c9628e130f45019bdefda0168089886.tar.bz2
Fix race condition in ConsumerBase::addReleaseFence()
This needs the ConsumerBase mutex locked, but wasn't locking it. Two of the four places that called it already held the lock so were fine. Now addReleaseFence() takes the lock itself, and I added addReleaseFenceLocked() for the two already-locked callers, since in one of them dropping the lock would be inconvenient. Bug: 7289269 Change-Id: I7a5628adb516f8eec782aa6c14128202f96d7b0a
Diffstat (limited to 'libs/gui/SurfaceTexture.cpp')
-rw-r--r--libs/gui/SurfaceTexture.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 57bcd2c..b4dfb5e 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -484,7 +484,7 @@ status_t SurfaceTexture::syncForReleaseLocked(EGLDisplay dpy) {
return UNKNOWN_ERROR;
}
sp<Fence> fence(new Fence(fenceFd));
- status_t err = addReleaseFence(mCurrentTexture, fence);
+ status_t err = addReleaseFenceLocked(mCurrentTexture, fence);
if (err != OK) {
ST_LOGE("syncForReleaseLocked: error adding release fence: "
"%s (%d)", strerror(-err), err);