diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-05-05 12:53:55 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-05-05 12:53:55 +0000 |
commit | 3c61e20f081bf6fbab6d3483e5e7f71cb91c4974 (patch) | |
tree | 4d687030d8e848eb2c325e8234fb807f578df890 /ace/Countdown_Time.cpp | |
parent | 65ce81267a19f490a22443567c75276fc864cbd2 (diff) | |
download | ATCD-RepositoryManager.tar.gz |
This commit was manufactured by cvs2svn to create branchRepositoryManager
'RepositoryManager'.
Diffstat (limited to 'ace/Countdown_Time.cpp')
-rw-r--r-- | ace/Countdown_Time.cpp | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/ace/Countdown_Time.cpp b/ace/Countdown_Time.cpp deleted file mode 100644 index b8556633cb1..00000000000 --- a/ace/Countdown_Time.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "ace/Countdown_Time.h" -#include "ace/OS_NS_sys_time.h" - -ACE_RCSID (ace, - Countdown_Time, - "$Id$") - -ACE_Countdown_Time::ACE_Countdown_Time (ACE_Time_Value *max_wait_time) - : max_wait_time_ (max_wait_time), - stopped_ (0) -{ - this->start (); -} - -ACE_Countdown_Time::~ACE_Countdown_Time (void) -{ - this->stop (); -} - -int -ACE_Countdown_Time::start (void) -{ - if (this->max_wait_time_ != 0) - { - this->start_time_ = ACE_OS::gettimeofday (); - this->stopped_ = 0; - } - return 0; -} - -int -ACE_Countdown_Time::stopped (void) const -{ - return stopped_; -} - -int -ACE_Countdown_Time::stop (void) -{ - if (this->max_wait_time_ != 0 && this->stopped_ == 0) - { - ACE_Time_Value elapsed_time = - ACE_OS::gettimeofday () - this->start_time_; - - if (*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_ = 1; - } - return 0; -} - -int -ACE_Countdown_Time::update (void) -{ - return this->stop () == 0 && this->start (); -} |