[Tizen] Idler hotfix using small size counter 99/222199/1
authorSeungho, Baek <sbsh.baek@samsung.com>
Fri, 10 Jan 2020 09:39:00 +0000 (18:39 +0900)
committerSeungho, Baek <sbsh.baek@samsung.com>
Fri, 10 Jan 2020 09:39:00 +0000 (18:39 +0900)
Change-Id: Ice8b7eb793f821e0e0084eb0ed08751edc1dab08
Signed-off-by: Seungho, Baek <sbsh.baek@samsung.com>
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h

index 6049e0e..eaeeb2d 100755 (executable)
@@ -86,6 +86,8 @@ namespace Adaptor
 namespace
 {
 thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get
+
+const uint32_t MAX_IDLE_COUNT = 10;
 } // unnamed namespace
 
 Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
@@ -914,9 +916,9 @@ void Adaptor::RequestProcessEventsOnIdle( bool forceProcess )
 {
   // Only request a notification if the Adaptor is actually running
   // and we haven't installed the idle notification
-  if( ( ! mNotificationOnIdleInstalled ) && ( RUNNING == mState || READY == mState || forceProcess ) )
+  if( ( mNotificationOnIdleInstalled < MAX_IDLE_COUNT ) && ( RUNNING == mState || READY == mState || forceProcess ) )
   {
-    mNotificationOnIdleInstalled = AddIdleEnterer( MakeCallback( this, &Adaptor::ProcessCoreEventsFromIdle ), forceProcess );
+    mNotificationOnIdleInstalled += ( AddIdleEnterer( MakeCallback( this, &Adaptor::ProcessCoreEventsFromIdle ), forceProcess ) ) ? 1 : 0;
   }
 }
 
@@ -1078,7 +1080,7 @@ bool Adaptor::ProcessCoreEventsFromIdle()
   ProcessCoreEvents();
 
   // the idle handle automatically un-installs itself
-  mNotificationOnIdleInstalled = false;
+  mNotificationOnIdleInstalled--;
 
   return false;
 }
@@ -1140,7 +1142,7 @@ Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor,
   mWindows(),
   mPlatformAbstraction( nullptr ),
   mCallbackManager( nullptr ),
-  mNotificationOnIdleInstalled( false ),
+  mNotificationOnIdleInstalled( 0 ),
   mNotificationTrigger( nullptr ),
   mDaliFeedbackPlugin(),
   mFeedbackController( nullptr ),
index c151865..d79e6f5 100755 (executable)
@@ -660,7 +660,7 @@ private: // Data
   TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction;      ///< Platform abstraction
 
   CallbackManager*                      mCallbackManager;             ///< Used to install callbacks
-  bool                                  mNotificationOnIdleInstalled; ///< whether the idle handler is installed to send an notification event
+  uint32_t                              mNotificationOnIdleInstalled; ///< whether the idle handler is installed to send an notification event
   TriggerEventInterface*                mNotificationTrigger;         ///< Notification event trigger
   FeedbackPluginProxy*                  mDaliFeedbackPlugin;          ///< Used to access feedback support
   FeedbackController*                   mFeedbackController;          ///< Plays feedback effects for Dali-Toolkit UI Controls.