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

Commit 7b960a5d authored by Andy Hung's avatar Andy Hung Committed by android-build-merger
Browse files

LockWatch: Update to Mutex::timeLock specs

am: 51a63191

Change-Id: I1c392e49cdd37df9ae313243b090fb3a69a7d811
parents 52eb0975 51a63191
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -32,9 +32,13 @@ bool LockWatch::threadLoop()
    while (!exitPending()) {
    while (!exitPending()) {
        // we neglect previous lock time effect on period
        // we neglect previous lock time effect on period
        usleep(mPeriodMs * 1000);
        usleep(mPeriodMs * 1000);
        if (mLock.timedLock(milliseconds(mTimeOutMs)) != NO_ERROR) {
        if (mLock.timedLock(ms2ns(mTimeOutMs)) != NO_ERROR) {
            // FIXME: Current implementation of timedLock uses CLOCK_REALTIME which
            // increments even during CPU suspend.  Check twice to be sure.
            if (mLock.timedLock(ms2ns(mTimeOutMs)) != NO_ERROR) {
                LOG_ALWAYS_FATAL("LockWatch timeout for: %s", mTag.string());
                LOG_ALWAYS_FATAL("LockWatch timeout for: %s", mTag.string());
            }
            }
        }
        mLock.unlock();
        mLock.unlock();
    }
    }
    return false;
    return false;