summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-08-17 12:45:40 -0700
committerMathias Agopian <mathias@google.com>2011-08-17 12:45:40 -0700
commit1a227437be33157175b4de5f47d08a02647ee71a (patch)
tree44a03020d91b45e6b604c2ec8c33d6185523c2e0 /libs
parent21fb6343ce079c23502b6969019d6b8795c47eb5 (diff)
downloadframeworks_base-1a227437be33157175b4de5f47d08a02647ee71a.zip
frameworks_base-1a227437be33157175b4de5f47d08a02647ee71a.tar.gz
frameworks_base-1a227437be33157175b4de5f47d08a02647ee71a.tar.bz2
fix a small race condition when returning the default width/height of a SurfaceTexture
Change-Id: I581bf609505dfb5d4ec5957b2ef2c77df6cfb15f
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/SurfaceTexture.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 7ac4343..b2441ce 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -482,17 +482,16 @@ status_t SurfaceTexture::queueBuffer(int buf, int64_t timestamp,
mSlots[buf].mScalingMode = mNextScalingMode;
mSlots[buf].mTimestamp = timestamp;
mDequeueCondition.signal();
+
+ *outWidth = mDefaultWidth;
+ *outHeight = mDefaultHeight;
+ *outTransform = 0;
} // scope for the lock
// call back without lock held
if (listener != 0) {
listener->onFrameAvailable();
}
-
- *outWidth = mDefaultWidth;
- *outHeight = mDefaultHeight;
- *outTransform = 0;
-
return OK;
}