From aa8cbe0b64fb84cadf0fbf7da1690a922085ca5f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 26 Dec 2008 22:27:02 +0000 Subject: [PATCH] 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 --- include/wx/unix/private/timer.h | 5 +++-- src/unix/timerunx.cpp | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/wx/unix/private/timer.h b/include/wx/unix/private/timer.h index 535ba7db95..2249fe5c2e 100644 --- a/include/wx/unix/private/timer.h +++ b/include/wx/unix/private/timer.h @@ -110,8 +110,9 @@ public: // it returns false if there are no timers bool GetNext(wxUsecClock_t *remaining) const; - // trigger the timer event for all timers which have expired - void NotifyExpired(); + // trigger the timer event for all timers which have expired, return true + // if any did + bool NotifyExpired(); private: // ctor and dtor are private, this is a singleton class only created by diff --git a/src/unix/timerunx.cpp b/src/unix/timerunx.cpp index c3c563af04..d6ee503df5 100644 --- a/src/unix/timerunx.cpp +++ b/src/unix/timerunx.cpp @@ -134,10 +134,12 @@ bool wxTimerScheduler::GetNext(wxUsecClock_t *remaining) const return true; } -void wxTimerScheduler::NotifyExpired() +bool wxTimerScheduler::NotifyExpired() { if ( m_timers.empty() ) - return; + return false; + + bool notified = false; const wxUsecClock_t now = wxGetLocalTimeUsec(); @@ -182,7 +184,10 @@ void wxTimerScheduler::NotifyExpired() // and finally notify the timer timer->Notify(); + notified = true; } + + return notified; } // ============================================================================ -- 2.45.2