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

Commit 4d0dd997 authored by Andy Hung's avatar Andy Hung Committed by gitbuildkicker
Browse files

LockWatch: Update to Mutex::timeLock specs

Bug: 31008450
Change-Id: Ib86e3a385379e222f5c3eb07a36bba9e5b6f5625
parent 46973ea6
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;