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

Commit fa5f8df1 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

SF: Add thread saftey static analysis for InputWindowCommands

ref: http://clang.llvm.org/docs/ThreadSafetyAnalysis.html
Bug: 124061013
Test: n/a static analysis

Change-Id: Ide594386d1e1bf3857be418b3f305c68bebd520e
parent ec0ab384
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -534,11 +534,11 @@ private:
    void handleMessageRefresh();

    void handleTransaction(uint32_t transactionFlags);
    void handleTransactionLocked(uint32_t transactionFlags);
    void handleTransactionLocked(uint32_t transactionFlags) REQUIRES(mStateLock);

    void updateInputFlinger();
    void updateInputWindowInfo();
    void commitInputWindowCommands();
    void commitInputWindowCommands() REQUIRES(mStateLock);
    void executeInputWindowCommands();
    void updateCursorAsync();

@@ -567,7 +567,8 @@ private:
                                       const Vector<ComposerState>& states);
    uint32_t setClientStateLocked(const ComposerState& composerState);
    uint32_t setDisplayStateLocked(const DisplayState& s);
    uint32_t addInputWindowCommands(const InputWindowCommands& inputWindowCommands);
    uint32_t addInputWindowCommands(const InputWindowCommands& inputWindowCommands)
            REQUIRES(mStateLock);

    /* ------------------------------------------------------------------------
     * Layer management
@@ -1145,9 +1146,8 @@ private:
    /* ------------------------------------------------------------------------ */
    sp<IInputFlinger> mInputFlinger;

    // Access must be protected by mStateLock.
    InputWindowCommands mPendingInputWindowCommands;
    // Should only be accessed by the drawing thread.
    InputWindowCommands mPendingInputWindowCommands GUARDED_BY(mStateLock);
    // Should only be accessed by the main thread.
    InputWindowCommands mInputWindowCommands;

    ui::DisplayPrimaries mInternalDisplayPrimaries;
+1 −0
Original line number Diff line number Diff line
@@ -234,6 +234,7 @@ public:
    }

    auto handleTransactionLocked(uint32_t transactionFlags) {
        Mutex::Autolock _l(mFlinger->mStateLock);
        return mFlinger->handleTransactionLocked(transactionFlags);
    }