void Adaptor::RequestProcessEventsOnIdle()
{
// Only request a notification if the Adaptor is actually running
- if ( RUNNING == mState )
+ // and we haven't installed the idle notification
+ if( ( ! mNotificationOnIdleInstalled ) && ( RUNNING == mState ) )
{
- boost::unique_lock<boost::mutex> lock( mIdleInstaller );
-
- // check if the idle handle is already installed
- if( mNotificationOnIdleInstalled )
- {
- return;
- }
mNotificationOnIdleInstalled = AddIdle( boost::bind( &Adaptor::ProcessCoreEventsFromIdle, this ) );
}
}
virtual void RequestUpdate();
/**
- * Call by the Dali core when it requires an notification event being sent on idle
+ * Called by Dali core when it requires an notification event being sent on idle.
+ * Multi-threading note: this method must be called from the main thread only.
*/
virtual void RequestProcessEventsOnIdle();
bool mNotificationOnIdleInstalled; ///< whether the idle handler is installed to send an notification event
TriggerEvent* mNotificationTrigger; ///< Notification event trigger
GestureManager* mGestureManager; ///< Gesture manager
- boost::mutex mIdleInstaller; ///< mutex to ensure two threads don't try to install idle handler at the same time
size_t mHDpi; ///< Override horizontal DPI
size_t mVDpi; ///< Override vertical DPI
FeedbackPluginProxy* mDaliFeedbackPlugin; ///< Used to access feedback support