summaryrefslogtreecommitdiff
path: root/ace/Timer_Wheel_T.cpp
diff options
context:
space:
mode:
authorjha <jha@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-06-30 19:32:33 +0000
committerjha <jha@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-06-30 19:32:33 +0000
commit231969a6f64176f994c43542f8f721a70cf56a95 (patch)
tree57d830ed0f4be86f6c46ccf2bec877bf5dd63a07 /ace/Timer_Wheel_T.cpp
parent5ce9ef47a2741413caa701324ba7beaa65b83162 (diff)
downloadATCD-231969a6f64176f994c43542f8f721a70cf56a95.tar.gz
Committing changes made after the merge from the mainline.
Diffstat (limited to 'ace/Timer_Wheel_T.cpp')
-rw-r--r--ace/Timer_Wheel_T.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/ace/Timer_Wheel_T.cpp b/ace/Timer_Wheel_T.cpp
index 7b0ed2c30a2..dc7ffe7e01e 100644
--- a/ace/Timer_Wheel_T.cpp
+++ b/ace/Timer_Wheel_T.cpp
@@ -14,7 +14,6 @@
ACE_RCSID(ace, Timer_Wheel_T, "$Id$")
-
/**
* Just initializes the iterator with a ACE_Timer_Wheel_T and then calls
* first() to initialize the rest of itself.
@@ -676,7 +675,6 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::iter (void)
return *this->iterator_;
}
-
/**
* Dummy version of expire to get rid of warnings in Sun CC 4.2
* Just call the expire of the base class.
@@ -687,7 +685,6 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::expire ()
return ACE_Timer_Queue_T<TYPE,FUNCTOR,ACE_LOCK>::expire ();
}
-
/**
* This is a specialized version of expire that is more suited for the
* internal data representation. Notice that we are still expiring
@@ -796,6 +793,27 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK>::expire (
}
while (earliest_pos != this->wheel_size_);
+ // Look for a new earliest time
+
+ earliest_time = ACE_Time_Value::zero;
+
+ // Check every entry in the table
+ for (i = 0; i < this->wheel_size_; i++)
+ {
+ // Skip empty entries
+ if (this->wheel_[i]->get_next () != this->wheel_[i])
+ {
+ // if initialization or if the time is earlier
+ if (earliest_time == ACE_Time_Value::zero
+ || this->wheel_[i]->get_timer_value () < earliest_time)
+ {
+ earliest_time =
+ this->wheel_[i]->get_next ()->get_timer_value ();
+ this->earliest_pos_ = i;
+ }
+ }
+ }
+
return number_of_timers_expired;
}