The DoubleBufferedTexture currently uses a mutex to protect access
to m_frontTexture on the producer functions. This mutex is not needed
in the producerLock/producerRelease functions as they will always be
called by the thread that sets m_frontTexture. Additionally, this
data will be initialized before calls to those funtions as the thread
must always call aquireContext() before calling these functions.
Change-Id: I110ad357c5eed4c0f5501761174e0da4b872af5d
http://b/
3089605
}
TextureInfo* DoubleBufferedTexture::producerLock() {
- m_varLock.lock();
SharedTexture* sharedTex = getFrontTexture();
- m_varLock.unlock();
LOGV("Acquiring P Lock (%d)", sharedTex->getSourceTextureId());
TextureInfo* texInfo = sharedTex->lockSource();
LOGV("Acquired P Lock");
}
void DoubleBufferedTexture::producerRelease() {
- m_varLock.lock();
// get the front texture and cache the id
SharedTexture* sharedTex = getFrontTexture();
LOGV("Releasing P Lock (%d)", sharedTex->getSourceTextureId());
- m_varLock.unlock();
sharedTex->releaseSource();