From 150ecd8c1bd5543bf0a65ac838a7409131106716 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Thu, 8 May 2014 14:56:50 -0700 Subject: [PATCH] Add mutex Change-Id: I81072031e74a5cca8384e4e8bce4babf2187d8bb --- services/surfaceflinger/DispSync.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/surfaceflinger/DispSync.cpp b/services/surfaceflinger/DispSync.cpp index fd4682225..2ee757036 100644 --- a/services/surfaceflinger/DispSync.cpp +++ b/services/surfaceflinger/DispSync.cpp @@ -509,6 +509,7 @@ void DispSync::resetErrorLocked() { } nsecs_t DispSync::computeNextRefresh(int periodOffset) const { + Mutex::Autolock lock(mMutex); nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC); return (((now - mPhase) / mPeriod) + periodOffset + 1) * mPeriod + mPhase; }