Add mutex
Change-Id: I81072031e74a5cca8384e4e8bce4babf2187d8bb
This commit is contained in:
parent
98e1ebc026
commit
150ecd8c1b
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user