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

Commit 5fd8de70 authored by Andy Hung's avatar Andy Hung Committed by android-build-merger
Browse files

LockWatch: Update to Mutex::timeLock specs am: 51a63191 am: 7b960a5d am: ffd7edc6

am: 78e800e9

Change-Id: Ide1e3fcbc0fd24457960944bd32384ed993a9aea
parents 05e4c8d8 78e800e9
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -32,9 +32,13 @@ bool LockWatch::threadLoop()
    while (!exitPending()) {
        // we neglect previous lock time effect on period
        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());
            }
        }
        mLock.unlock();
    }
    return false;