am d2d5a64a
: workaround a deadlock when taking screenshots into a surface
* commit 'd2d5a64aa21cfc548c8c8333d1b36979e5e5a640': workaround a deadlock when taking screenshots into a surface
This commit is contained in:
commit
5e80aa10d3
@ -995,7 +995,7 @@ void BufferQueue::freeAllBuffersExceptHeadLocked() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t BufferQueue::drainQueueLocked() {
|
status_t BufferQueue::drainQueueLocked() {
|
||||||
while (mSynchronousMode && !mQueue.isEmpty()) {
|
while (mSynchronousMode && mQueue.size() > 1) {
|
||||||
mDequeueCondition.wait(mMutex);
|
mDequeueCondition.wait(mMutex);
|
||||||
if (mAbandoned) {
|
if (mAbandoned) {
|
||||||
ST_LOGE("drainQueueLocked: BufferQueue has been abandoned!");
|
ST_LOGE("drainQueueLocked: BufferQueue has been abandoned!");
|
||||||
@ -1012,7 +1012,7 @@ status_t BufferQueue::drainQueueLocked() {
|
|||||||
status_t BufferQueue::drainQueueAndFreeBuffersLocked() {
|
status_t BufferQueue::drainQueueAndFreeBuffersLocked() {
|
||||||
status_t err = drainQueueLocked();
|
status_t err = drainQueueLocked();
|
||||||
if (err == NO_ERROR) {
|
if (err == NO_ERROR) {
|
||||||
if (mSynchronousMode) {
|
if (mQueue.empty()) {
|
||||||
freeAllBuffersLocked();
|
freeAllBuffersLocked();
|
||||||
} else {
|
} else {
|
||||||
freeAllBuffersExceptHeadLocked();
|
freeAllBuffersExceptHeadLocked();
|
||||||
|
Loading…
Reference in New Issue
Block a user