diff options
Diffstat (limited to 'ACE/ace/Countdown_Time.cpp')
-rw-r--r-- | ACE/ace/Countdown_Time.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/ACE/ace/Countdown_Time.cpp b/ACE/ace/Countdown_Time.cpp index 4c95e2acfa1..335931514e4 100644 --- a/ACE/ace/Countdown_Time.cpp +++ b/ACE/ace/Countdown_Time.cpp @@ -1,9 +1,11 @@ +// $Id$ + #include "ace/Countdown_Time.h" #include "ace/OS_NS_sys_time.h" -ACE_RCSID (ace, - Countdown_Time, - "$Id$") +#if !defined (__ACE_INLINE__) +#include "ace/Countdown_Time.inl" +#endif /* __ACE_INLINE__ */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -29,20 +31,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 +54,4 @@ ACE_Countdown_Time::stop (void) } } -void -ACE_Countdown_Time::update (void) -{ - this->stop (); - this->start (); -} - ACE_END_VERSIONED_NAMESPACE_DECL |