diff options
author | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-04 04:40:04 +0000 |
---|---|---|
committer | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-04 04:40:04 +0000 |
commit | b5ef4f072bc70e46a9b6906ab4ae0c927991c70b (patch) | |
tree | 12870092c07ee90ad3c29d34f6dd8f029b8d31e9 /ace/Timer_List_T.cpp | |
parent | 324555974e0b06a0cd244a3b705da7c84049c84d (diff) | |
download | ATCD-b5ef4f072bc70e46a9b6906ab4ae0c927991c70b.tar.gz |
Changed the name "lock_" to "mutex_".
Diffstat (limited to 'ace/Timer_List_T.cpp')
-rw-r--r-- | ace/Timer_List_T.cpp | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/ace/Timer_List_T.cpp b/ace/Timer_List_T.cpp index 73e84ce5aee..e64e13ee4e2 100644 --- a/ace/Timer_List_T.cpp +++ b/ace/Timer_List_T.cpp @@ -19,7 +19,7 @@ ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_List_Iterator_T (A // Positions the iterator at the node right after the dummy node -template <class TYPE, class FUNCTOR, class ACE_LOCK> void +template <class TYPE, class FUNCTOR, class ACE_LOCK> void ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::first (void) { this->position_ = this->timer_list_.head_->get_next (); @@ -27,7 +27,7 @@ ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::first (void) // Positions the iterator at the next node in the Timer Queue -template <class TYPE, class FUNCTOR, class ACE_LOCK> void +template <class TYPE, class FUNCTOR, class ACE_LOCK> void ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::next (void) { // Make sure that if we are at the end, we don't wrap around @@ -37,7 +37,7 @@ ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::next (void) // Returns true when we are at <head_> -template <class TYPE, class FUNCTOR, class ACE_LOCK> int +template <class TYPE, class FUNCTOR, class ACE_LOCK> int ACE_Timer_List_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::isdone (void) { return this->position_ == this->timer_list_.head_; @@ -64,7 +64,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::iter (void) // Create an empty list. -template <class TYPE, class FUNCTOR, class ACE_LOCK> +template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_List_T (FUNCTOR *upcall_functor, ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist) : ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> (upcall_functor, freelist), @@ -81,7 +81,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_List_T (FUNCTOR *upcall_fun // Checks if list is empty. -template <class TYPE, class FUNCTOR, class ACE_LOCK> int +template <class TYPE, class FUNCTOR, class ACE_LOCK> int ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::is_empty (void) const { ACE_TRACE ("ACE_Timer_List_T::is_empty"); @@ -101,16 +101,16 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::earliest_time (void) const // Remove all remaining items in the list. -template <class TYPE, class FUNCTOR, class ACE_LOCK> +template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_List_T (void) { ACE_TRACE ("ACE_Timer_List_T::~ACE_Timer_List_T"); - ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->lock_)); - + ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_)); + delete iterator_; ACE_Timer_Node_T<TYPE> *curr = this->head_->get_next (); - + while (curr != this->head_) { ACE_Timer_Node_T<TYPE> *next = curr->get_next (); @@ -124,7 +124,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_List_T (void) } -template <class TYPE, class FUNCTOR, class ACE_LOCK> void +template <class TYPE, class FUNCTOR, class ACE_LOCK> void ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const { ACE_TRACE ("ACE_Timer_List_T::dump"); @@ -138,23 +138,23 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const } ACE_DEBUG ((LM_DEBUG, "\nsize_ = %d", count)); ACE_DEBUG ((LM_DEBUG, "\ntimer_id_ = %d", this->timer_id_)); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } // Reschedule a periodic timer. This function must be called with the // lock held. -template <class TYPE, class FUNCTOR, class ACE_LOCK> void +template <class TYPE, class FUNCTOR, class ACE_LOCK> void ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::reschedule (ACE_Timer_Node_T<TYPE> *expired) { ACE_TRACE ("ACE_Timer_List_T::reschedule"); ACE_Timer_Node_T<TYPE> *after = this->head_->get_next (); - // Locate the proper position in the queue. + // Locate the proper position in the queue. - while (after != this->head_ + while (after != this->head_ && expired->get_timer_value () > after->get_timer_value ()) after = after->get_next (); @@ -171,25 +171,25 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::reschedule (ACE_Timer_Node_T<TYPE> *e template <class TYPE, class FUNCTOR, class ACE_LOCK> long ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::schedule (const TYPE &type, const void *act, - const ACE_Time_Value &future_time, + const ACE_Time_Value &future_time, const ACE_Time_Value &interval) { ACE_TRACE ("ACE_Timer_List_T::schedule"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1)); + ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); // Place in the middle of the list where it belongs (i.e., sorted in // ascending order of absolute time to expire). ACE_Timer_Node_T<TYPE> *after = this->head_->get_next (); - + while (after != this->head_ && future_time > after->get_timer_value ()) after = after->get_next (); ACE_Timer_Node_T<TYPE> *temp = this->alloc_node (); - temp->set (type, - act, + temp->set (type, + act, future_time, - interval, + interval, after->get_prev (), after, (long) temp); @@ -210,27 +210,27 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (long timer_id, int dont_call) { ACE_TRACE ("ACE_Timer_List_T::cancel"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1)); + ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); // Make sure we are getting a valid <timer_id>, not an error // returned by schedule () if (timer_id == -1) return 0; - + ACE_Timer_Node_T<TYPE> *node = (ACE_Timer_Node_T<TYPE> *) timer_id; - + // Check to see if the node looks like a true ACE_Timer_Node_T<TYPE> if (timer_id == node->get_timer_id ()) { node->get_next ()->set_prev (node->get_prev ()); node->get_prev ()->set_next (node->get_next ()); - + if (act != 0) *act = node->get_act (); if (dont_call == 0) this->upcall_functor ().cancellation (*this, node->get_type ()); - + this->free_node (node); return 1; } @@ -247,7 +247,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (const TYPE &type, int dont_call) { ACE_TRACE ("ACE_Timer_List_T::cancel"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1)); + ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); ACE_Timer_Node_T<TYPE> *curr = this->head_->get_next (); @@ -276,7 +276,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (const TYPE &type, } -// Removes the first node on the list and returns it. +// Removes the first node on the list and returns it. template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> * ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first (void) @@ -287,10 +287,9 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first (void) ACE_Timer_Node_T<TYPE> *temp = this->head_->get_next (); this->head_->set_next (temp->get_next ()); temp->get_next ()->set_prev (this->head_); - + return temp; } #endif /* ACE_TIMER_LIST_T_C */ - |