return true if we did anything in NotifyExpired()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -110,8 +110,9 @@ public:
|
|||||||
// it returns false if there are no timers
|
// it returns false if there are no timers
|
||||||
bool GetNext(wxUsecClock_t *remaining) const;
|
bool GetNext(wxUsecClock_t *remaining) const;
|
||||||
|
|
||||||
// trigger the timer event for all timers which have expired
|
// trigger the timer event for all timers which have expired, return true
|
||||||
void NotifyExpired();
|
// if any did
|
||||||
|
bool NotifyExpired();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// ctor and dtor are private, this is a singleton class only created by
|
// ctor and dtor are private, this is a singleton class only created by
|
||||||
|
@@ -134,10 +134,12 @@ bool wxTimerScheduler::GetNext(wxUsecClock_t *remaining) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTimerScheduler::NotifyExpired()
|
bool wxTimerScheduler::NotifyExpired()
|
||||||
{
|
{
|
||||||
if ( m_timers.empty() )
|
if ( m_timers.empty() )
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
|
bool notified = false;
|
||||||
|
|
||||||
const wxUsecClock_t now = wxGetLocalTimeUsec();
|
const wxUsecClock_t now = wxGetLocalTimeUsec();
|
||||||
|
|
||||||
@@ -182,7 +184,10 @@ void wxTimerScheduler::NotifyExpired()
|
|||||||
|
|
||||||
// and finally notify the timer
|
// and finally notify the timer
|
||||||
timer->Notify();
|
timer->Notify();
|
||||||
|
notified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return notified;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
Reference in New Issue
Block a user