Revert "Fix for thread contention issues in FrameTime object." 11/49211/2
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Thu, 8 Oct 2015 12:27:34 +0000 (05:27 -0700)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Thu, 8 Oct 2015 12:50:04 +0000 (05:50 -0700)
This reverts commit 9a878f148492cd20ea41a4111848bebaa71ff0e9.

Change-Id: I1cbe562e27460cf84f421cad7daf6680853dd5fc

adaptors/base/frame-time.cpp
adaptors/base/frame-time.h

index c8031a6..025a6a7 100644 (file)
@@ -88,7 +88,6 @@ void FrameTime::SetMinimumFrameTimeInterval( unsigned int interval )
 
 void FrameTime::SetSyncTime( unsigned int frameNumber )
 {
-  Dali::Mutex::ScopedLock lock( mMutex );
   // Only set the render time if we are running
   if ( mRunning )
   {
@@ -102,7 +101,6 @@ void FrameTime::SetSyncTime( unsigned int frameNumber )
 
 void FrameTime::Suspend()
 {
-  Dali::Mutex::ScopedLock lock( mMutex );
   mRunning = FALSE;
 
   // Reset members
@@ -150,7 +148,6 @@ void FrameTime::WakeUp()
 
 void FrameTime::PredictNextSyncTime( float& lastFrameDeltaSeconds, unsigned int& lastSyncTimeMilliseconds, unsigned int& nextSyncTimeMilliseconds )
 {
-  Dali::Mutex::ScopedLock lock( mMutex );
   if ( mRunning )
   {
     const unsigned int minimumFrameTimeInterval( mMinimumFrameTimeInterval );
index c3cb363..42bc596 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <stdint.h>
-#include <dali/devel-api/common/mutex.h>
 
 namespace Dali
 {
@@ -119,21 +118,20 @@ private:
 
   unsigned int mMinimumFrameTimeInterval; ///< The minimum frame time interval, set by Adaptor.
 
-  volatile uint64_t mLastSyncTime;                ///< The last Sync time (in microseconds).
-  volatile uint64_t mLastSyncTimeAtUpdate;        ///< The last Sync time at Update (in microseconds).
+  uint64_t mLastSyncTime;                ///< The last Sync time (in microseconds).
+  uint64_t mLastSyncTimeAtUpdate;        ///< The last Sync time at Update (in microseconds).
 
   unsigned int mLastSyncFrameNumber;     ///< The last Sync frame number
   unsigned int mLastUpdateFrameNumber;   ///< The last Sync frame number handled in Update.
 
   // NOTE cannot use bitfields or booleans as these are used from multiple threads, must use variable with machine word size for atomic read/write
-  volatile unsigned int mRunning;        ///< The state of the FrameTime object.
+  unsigned int mRunning;                 ///< The state of the FrameTime object.
   unsigned int mFirstFrame;              ///< Whether the current update is the first frame (after initialisation, resume or wake up).
 
   unsigned int mPreviousUpdateFrames[3]; ///< Array holding the number of frames Update took in the last three iterations.
   unsigned int writePos;                 ///< The current write position in the array.
 
   unsigned int mExtraUpdatesSinceSync;   ///< The number of extra updates since the last Sync.
-  Dali::Mutex mMutex;                    ///< Mutex to ensure correct access locking.
 };
 
 } // namespace Adaptor