diff --git a/modules/beast_core/memory/beast_PagedFreeStore.cpp b/modules/beast_core/memory/beast_PagedFreeStore.cpp index fe022ecfc..683f1c24e 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 1ea8e516b..6d8d1bba0 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 debfebe81..b5404c8fa 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;