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

Commit 544a3eb0 authored by Ady Abraham's avatar Ady Abraham Committed by Automerger Merge Worker
Browse files

RESTRICT AUTOMERGE SurfaceFlinger: fix a potential race condition in...

RESTRICT AUTOMERGE SurfaceFlinger: fix a potential race condition in stealReceiveChannel am: 0840cdd0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/18766212



Change-Id: I4710ac999b560074a4cacbde6cf22ac1ad000e0d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents e26b6061 0840cdd0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -129,6 +129,11 @@ void EventThreadConnection::onFirstRef() {
}

status_t EventThreadConnection::stealReceiveChannel(gui::BitTube* outChannel) {
    std::scoped_lock lock(mLock);
    if (mChannel.initCheck() != NO_ERROR) {
        return NAME_NOT_FOUND;
    }

    outChannel->setReceiveFd(mChannel.moveReceiveFd());
    return NO_ERROR;
}
+2 −1
Original line number Diff line number Diff line
@@ -88,7 +88,8 @@ public:
private:
    virtual void onFirstRef();
    EventThread* const mEventThread;
    gui::BitTube mChannel;
    std::mutex mLock;
    gui::BitTube mChannel GUARDED_BY(mLock);
};

class EventThread {