Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e80aa10 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am d2d5a64a: workaround a deadlock when taking screenshots into a surface

* commit 'd2d5a64a':
  workaround a deadlock when taking screenshots into a surface
parents c75412dc d2d5a64a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -995,7 +995,7 @@ void BufferQueue::freeAllBuffersExceptHeadLocked() {
}

status_t BufferQueue::drainQueueLocked() {
    while (mSynchronousMode && !mQueue.isEmpty()) {
    while (mSynchronousMode && mQueue.size() > 1) {
        mDequeueCondition.wait(mMutex);
        if (mAbandoned) {
            ST_LOGE("drainQueueLocked: BufferQueue has been abandoned!");
@@ -1012,7 +1012,7 @@ status_t BufferQueue::drainQueueLocked() {
status_t BufferQueue::drainQueueAndFreeBuffersLocked() {
    status_t err = drainQueueLocked();
    if (err == NO_ERROR) {
        if (mSynchronousMode) {
        if (mQueue.empty()) {
            freeAllBuffersLocked();
        } else {
            freeAllBuffersExceptHeadLocked();