OSDN Git Service

Fix race condition in ConsumerBase::addReleaseFence()
authorJesse Hall <jessehall@google.com>
Fri, 5 Oct 2012 21:34:21 +0000 (14:34 -0700)
committerJesse Hall <jessehall@google.com>
Fri, 5 Oct 2012 21:40:50 +0000 (14:40 -0700)
commit9504eb915c9628e130f45019bdefda0168089886
tree1f571cdd5e5e20b674ecc666a2f107ac7949b9a6
parent0e8fcc2c27f278478483ebbe1befe1460e8bbed1
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
include/gui/ConsumerBase.h
libs/gui/BufferItemConsumer.cpp
libs/gui/ConsumerBase.cpp
libs/gui/SurfaceTexture.cpp