Add mutex

Change-Id: I81072031e74a5cca8384e4e8bce4babf2187d8bb
This commit is contained in:
Andy McFadden 2014-05-08 14:56:50 -07:00
parent 98e1ebc026
commit 150ecd8c1b

View File

@ -509,6 +509,7 @@ void DispSync::resetErrorLocked() {
} }
nsecs_t DispSync::computeNextRefresh(int periodOffset) const { nsecs_t DispSync::computeNextRefresh(int periodOffset) const {
Mutex::Autolock lock(mMutex);
nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
return (((now - mPhase) / mPeriod) + periodOffset + 1) * mPeriod + mPhase; return (((now - mPhase) / mPeriod) + periodOffset + 1) * mPeriod + mPhase;
} }