diff options
Diffstat (limited to 'ACE/ace/Countdown_Time.cpp')
-rw-r--r-- | ACE/ace/Countdown_Time.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/ACE/ace/Countdown_Time.cpp b/ACE/ace/Countdown_Time.cpp index 4c95e2acfa1..6a5731eafc2 100644 --- a/ACE/ace/Countdown_Time.cpp +++ b/ACE/ace/Countdown_Time.cpp @@ -5,6 +5,10 @@ ACE_RCSID (ace, Countdown_Time, "$Id$") +#if !defined (__ACE_INLINE__) +#include "ace/Countdown_Time.inl" +#endif /* __ACE_INLINE__ */ + ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Countdown_Time::ACE_Countdown_Time (ACE_Time_Value *max_wait_time) @@ -29,20 +33,16 @@ ACE_Countdown_Time::start (void) } } -bool -ACE_Countdown_Time::stopped (void) const -{ - return stopped_; -} - void ACE_Countdown_Time::stop (void) { - if (this->max_wait_time_ != 0 && this->stopped_ == false) + if (this->max_wait_time_ != 0 && !this->stopped_) { - ACE_Time_Value elapsed_time = ACE_OS::gettimeofday () - this->start_time_; + ACE_Time_Value const elapsed_time = + ACE_OS::gettimeofday () - this->start_time_; - if (*this->max_wait_time_ > elapsed_time) + if (elapsed_time >= ACE_Time_Value::zero && + *this->max_wait_time_ > elapsed_time) { *this->max_wait_time_ -= elapsed_time; } @@ -56,11 +56,4 @@ ACE_Countdown_Time::stop (void) } } -void -ACE_Countdown_Time::update (void) -{ - this->stop (); - this->start (); -} - ACE_END_VERSIONED_NAMESPACE_DECL |