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

Commit 7fcad0d1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes Ic448872c,Id4ef1891

* changes:
  blast: protect destruction of callback thread
  blast: check for buffer before dumping format
parents 4d77512f 99343bae
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -336,6 +336,9 @@ int BufferStateLayer::getDrawingApi() const {
}

PixelFormat BufferStateLayer::getPixelFormat() const {
    if (!mActiveBuffer) {
        return PIXEL_FORMAT_NONE;
    }
    return mActiveBuffer->format;
}

+5 −1
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@
namespace android {

TransactionCompletedThread::~TransactionCompletedThread() {
    std::lock_guard lockThread(mThreadMutex);

    {
        std::lock_guard lock(mMutex);
        mKeepRunning = false;
@@ -50,11 +52,13 @@ TransactionCompletedThread::~TransactionCompletedThread() {

void TransactionCompletedThread::run() {
    std::lock_guard lock(mMutex);
    if (mRunning) {
    if (mRunning || !mKeepRunning) {
        return;
    }
    mDeathRecipient = new ThreadDeathRecipient();
    mRunning = true;

    std::lock_guard lockThread(mThreadMutex);
    mThread = std::thread(&TransactionCompletedThread::threadMain, this);
}

+4 −1
Original line number Diff line number Diff line
@@ -90,7 +90,10 @@ private:
        }
    };

    std::thread mThread;
    // Protects the creation and destruction of mThread
    std::mutex mThreadMutex;

    std::thread mThread GUARDED_BY(mThreadMutex);

    std::mutex mMutex;
    std::condition_variable_any mConditionVariable;