summaryrefslogtreecommitdiff
path: root/ACE/ace/Countdown_Time.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/ace/Countdown_Time.cpp')
-rw-r--r--ACE/ace/Countdown_Time.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/ACE/ace/Countdown_Time.cpp b/ACE/ace/Countdown_Time.cpp
index fb03f0465e0..4c95e2acfa1 100644
--- a/ACE/ace/Countdown_Time.cpp
+++ b/ACE/ace/Countdown_Time.cpp
@@ -9,7 +9,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_Countdown_Time::ACE_Countdown_Time (ACE_Time_Value *max_wait_time)
: max_wait_time_ (max_wait_time),
- stopped_ (0)
+ stopped_ (false)
{
this->start ();
}
@@ -19,48 +19,48 @@ ACE_Countdown_Time::~ACE_Countdown_Time (void)
this->stop ();
}
-int
+void
ACE_Countdown_Time::start (void)
{
if (this->max_wait_time_ != 0)
{
this->start_time_ = ACE_OS::gettimeofday ();
- this->stopped_ = 0;
+ this->stopped_ = false;
}
- return 0;
}
-int
+bool
ACE_Countdown_Time::stopped (void) const
{
return stopped_;
}
-int
+void
ACE_Countdown_Time::stop (void)
{
- if (this->max_wait_time_ != 0 && this->stopped_ == 0)
+ if (this->max_wait_time_ != 0 && this->stopped_ == false)
{
- ACE_Time_Value elapsed_time =
- ACE_OS::gettimeofday () - this->start_time_;
+ ACE_Time_Value elapsed_time = ACE_OS::gettimeofday () - this->start_time_;
if (*this->max_wait_time_ > elapsed_time)
- *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;
+ this->stopped_ = true;
}
- return 0;
}
-int
+void
ACE_Countdown_Time::update (void)
{
- return this->stop () == 0 && this->start ();
+ this->stop ();
+ this->start ();
}
ACE_END_VERSIONED_NAMESPACE_DECL