From 83b9d22ff028273159c4e0091e75b471da376ae2 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 14 Sep 2013 19:59:34 -0700 Subject: [PATCH] Rename to DeadlineTimer::cancel() --- .../memory/beast_PagedFreeStore.cpp | 2 +- .../beast_core/thread/beast_DeadlineTimer.cpp | 9 +++--- .../beast_core/thread/beast_DeadlineTimer.h | 30 ++++++------------- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/modules/beast_core/memory/beast_PagedFreeStore.cpp b/modules/beast_core/memory/beast_PagedFreeStore.cpp index fe022ecfc9..683f1c24eb 100644 --- a/modules/beast_core/memory/beast_PagedFreeStore.cpp +++ b/modules/beast_core/memory/beast_PagedFreeStore.cpp @@ -97,7 +97,7 @@ PagedFreeStore::PagedFreeStore (const size_t pageBytes) PagedFreeStore::~PagedFreeStore () { - m_timer.reset (); + m_timer.cancel (); #if LOG_GC bassert (!m_used.isSignaled ()); diff --git a/modules/beast_core/thread/beast_DeadlineTimer.cpp b/modules/beast_core/thread/beast_DeadlineTimer.cpp index 1ea8e516b9..6d8d1bba0d 100644 --- a/modules/beast_core/thread/beast_DeadlineTimer.cpp +++ b/modules/beast_core/thread/beast_DeadlineTimer.cpp @@ -214,6 +214,11 @@ DeadlineTimer::~DeadlineTimer () m_manager->deactivate (*this); } +void DeadlineTimer::cancel () +{ + m_manager->deactivate (*this); +} + void DeadlineTimer::setExpiration (double secondsUntilDeadline) { bassert (secondsUntilDeadline != 0); @@ -237,7 +242,3 @@ void DeadlineTimer::setExpirationTime (Time const& when) m_manager->activate (*this, 0, when); } -void DeadlineTimer::reset () -{ - m_manager->deactivate (*this); -} diff --git a/modules/beast_core/thread/beast_DeadlineTimer.h b/modules/beast_core/thread/beast_DeadlineTimer.h index debfebe810..b5404c8fa0 100644 --- a/modules/beast_core/thread/beast_DeadlineTimer.h +++ b/modules/beast_core/thread/beast_DeadlineTimer.h @@ -45,13 +45,18 @@ public: ~DeadlineTimer (); + /** Cancel all notifications. + It is okay to call this on an inactive timer. + @note It is guaranteed that no notifications will occur after this + function returns. + */ + void cancel (); + + /** Set the timer to go off once in the future. - If the timer is already active, this will reset it. - @note If the timer is already active, the old one might go off before this function returns. - @param secondsUntilDeadline The number of seconds until the timer will send a notification. This must be greater than zero. @@ -59,12 +64,9 @@ public: void setExpiration (double secondsUntilDeadline); /** Set the timer to go off repeatedly with the specified frequency. - If the timer is already active, this will reset it. - @note If the timer is already active, the old one might go off before this function returns. - @param secondsUntilDeadline The number of seconds until the timer will send a notification. This must be greater than zero. @@ -72,28 +74,15 @@ public: void setRecurringExpiration (double secondsUntilDeadline); /** Set the timer to go off at a specific time. - If the timer is already active, this will reset it. - @note If the timer is already active, the old one might go off before this function returns. - @note If the time is in the past, the timer will go off immediately. */ void setExpirationTime (Time const& when); - /** Reset the timer so that no more notifications are sent. - - It is okay to call this on an inactive timer. - - @note It is guaranteed that no notifications will occur after this - function returns. - */ - void reset (); - /** Equality comparison. - Timers are equal if they have the same address. */ inline bool operator== (DeadlineTimer const& other) const @@ -101,8 +90,7 @@ public: return this == &other; } - /** Inequality comparison. - */ + /** Inequality comparison. */ inline bool operator!= (DeadlineTimer const& other) const { return this != &other;