diff options
author | Nay <dnpd.dd@gmail.com> | 2012-09-17 23:50:08 +0100 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2012-09-17 23:50:08 +0100 |
commit | 23961d0dce22e234e62f116469f04bb62d8986a7 (patch) | |
tree | ab271f0a3fffa8f21f9ac7fd669f457beb9eb356 /dep/acelite/ace/Countdown_Time.cpp | |
parent | 2431895a54b38e4c0e6444c740ff2298e31e26e2 (diff) | |
parent | 2e21fa6b925c4572d620248f1b149a5d652836b2 (diff) |
Merge remote-tracking branch 'origin/master' into mmaps
Diffstat (limited to 'dep/acelite/ace/Countdown_Time.cpp')
-rw-r--r-- | dep/acelite/ace/Countdown_Time.cpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/dep/acelite/ace/Countdown_Time.cpp b/dep/acelite/ace/Countdown_Time.cpp deleted file mode 100644 index c964ab1138a..00000000000 --- a/dep/acelite/ace/Countdown_Time.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// $Id: Countdown_Time.cpp 91287 2010-08-05 10:30:49Z johnnyw $ - -#include "ace/Countdown_Time.h" -#include "ace/OS_NS_sys_time.h" - -#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) - : max_wait_time_ (max_wait_time), - stopped_ (false) -{ - this->start (); -} - -ACE_Countdown_Time::~ACE_Countdown_Time (void) -{ - this->stop (); -} - -void -ACE_Countdown_Time::start (void) -{ - if (this->max_wait_time_ != 0) - { - this->start_time_ = ACE_OS::gettimeofday (); - this->stopped_ = false; - } -} - -void -ACE_Countdown_Time::stop (void) -{ - if (this->max_wait_time_ != 0 && !this->stopped_) - { - ACE_Time_Value const elapsed_time = - ACE_OS::gettimeofday () - this->start_time_; - - if (elapsed_time >= ACE_Time_Value::zero && - *this->max_wait_time_ > elapsed_time) - { - *this->max_wait_time_ -= elapsed_time; - } - else - { - // Used all of timeout. - *this->max_wait_time_ = ACE_Time_Value::zero; - // errno = ETIME; - } - this->stopped_ = true; - } -} - -ACE_END_VERSIONED_NAMESPACE_DECL |