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

Commit 675cb455 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Binder NDK tests: use std::mutex, not android::Mutex" into main am:...

Merge "Binder NDK tests: use std::mutex, not android::Mutex" into main am: c0a0bf9c am: 2d15f6f3

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



Change-Id: I1bc125844217002c927e12065a38fe656ba758d4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f3e02515 2d15f6f3
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -994,22 +994,22 @@ TEST(NdkBinder, GetAndVerifyScopedAIBinder_Weak) {

class MyResultReceiver : public BnResultReceiver {
   public:
    Mutex mMutex;
    Condition mCondition;
    std::mutex mMutex;
    std::condition_variable mCondition;
    bool mHaveResult = false;
    int32_t mResult = 0;

    virtual void send(int32_t resultCode) {
        AutoMutex _l(mMutex);
        std::unique_lock<std::mutex> _l(mMutex);
        mResult = resultCode;
        mHaveResult = true;
        mCondition.signal();
        mCondition.notify_one();
    }

    int32_t waitForResult() {
        AutoMutex _l(mMutex);
        std::unique_lock<std::mutex> _l(mMutex);
        while (!mHaveResult) {
            mCondition.wait(mMutex);
            mCondition.wait(_l);
        }
        return mResult;
    }