From 2cbe2c0b62b4c813d85d690910eb62b06d187610 Mon Sep 17 00:00:00 2001 From: coryan Date: Tue, 4 Nov 1997 00:38:45 +0000 Subject: ChangeLogTag:Mon Nov 03 18:32:42 1997 Carlos O'Ryan --- ChangeLog-97b | 13 +++++++++++++ ace/Atomic_Op.i | 28 ++++++++++++++-------------- ace/Proactor.cpp | 2 +- ace/Synch_T.cpp | 8 ++++---- ace/Synch_T.h | 5 +++-- ace/Timer_Heap.cpp | 20 ++++++++++++++++++++ ace/Timer_Heap_T.cpp | 6 +++--- ace/Timer_List.cpp | 21 +++++++++++++++++++++ ace/Timer_Queue.cpp | 21 +++++++++++++++++++++ ace/Timer_Queue_Adapters.cpp | 4 ++-- ace/Timer_Queue_Adapters.h | 4 ++-- ace/Timer_Queue_T.cpp | 8 ++++---- ace/Timer_Queue_T.h | 5 +++-- 13 files changed, 111 insertions(+), 34 deletions(-) diff --git a/ChangeLog-97b b/ChangeLog-97b index c8baed6929b..d4c5a075120 100644 --- a/ChangeLog-97b +++ b/ChangeLog-97b @@ -1,3 +1,16 @@ +Mon Nov 03 18:32:42 1997 Carlos O'Ryan + + * ace/Proactor.cpp: + * ace/Timer_Queue_T.h: + * ace/Timer_Queue_T.cpp: + * ace/Timer_Heap_T.cpp: + * ace/Synch_T.h: + * ace/Synch_T.cpp: + * ace/Atomic_Op.i: + Changed the method name from lock() to mutex(), otherwise the + lame HP/C++ compiler gets completely confused. Also changed the + field from lock_ to mutex_ + Mon Nov 3 17:15:17 1997 Steve Huston * ace/OS.h: Removed "class ace_dewarn_gplusplus;" from the diff --git a/ace/Atomic_Op.i b/ace/Atomic_Op.i index c79047a48b4..e405007406f 100644 --- a/ace/Atomic_Op.i +++ b/ace/Atomic_Op.i @@ -4,7 +4,7 @@ template ACE_INLINE TYPE ACE_Atomic_Op::operator++ (void) { // ACE_TRACE ("ACE_Atomic_Op::operator++"); - ACE_Guard m (this->lock_); + ACE_Guard m (this->mutex_); return ++this->value_; } @@ -12,7 +12,7 @@ template ACE_INLINE TYPE ACE_Atomic_Op::operator+= (const TYPE &i) { // ACE_TRACE ("ACE_Atomic_Op::operator+="); - ACE_Guard m (this->lock_); + ACE_Guard m (this->mutex_); return this->value_ += i; } @@ -20,7 +20,7 @@ template ACE_INLINE TYPE ACE_Atomic_Op::operator-- (void) { // ACE_TRACE ("ACE_Atomic_Op::operator--"); - ACE_Guard m (this->lock_); + ACE_Guard m (this->mutex_); return --this->value_; } @@ -28,7 +28,7 @@ template ACE_INLINE TYPE ACE_Atomic_Op::operator-= (const TYPE &i) { // ACE_TRACE ("ACE_Atomic_Op::operator-="); - ACE_Guard m (this->lock_); + ACE_Guard m (this->mutex_); return this->value_ -= i; } @@ -43,7 +43,7 @@ template ACE_INLINE TYPE ACE_Atomic_Op::operator++ (int) { // ACE_TRACE ("ACE_Atomic_Op::operator++"); - ACE_Guard m (this->lock_); + ACE_Guard m (this->mutex_); return this->value_++; } @@ -51,7 +51,7 @@ template ACE_INLINE TYPE ACE_Atomic_Op::operator-- (int) { // ACE_TRACE ("ACE_Atomic_Op::operator--"); - ACE_Guard m (this->lock_); + ACE_Guard m (this->mutex_); return this->value_--; } @@ -59,7 +59,7 @@ template ACE_INLINE int ACE_Atomic_Op::operator== (const TYPE &i) const { // ACE_TRACE ("ACE_Atomic_Op::operator=="); - ACE_Guard m ((ACE_LOCK &) this->lock_); + ACE_Guard m ((ACE_LOCK &) this->mutex_); return this->value_ == i; } @@ -74,7 +74,7 @@ template ACE_INLINE int ACE_Atomic_Op::operator>= (const TYPE &i) const { // ACE_TRACE ("ACE_Atomic_Op::operator>="); - ACE_Guard m ((ACE_LOCK &) this->lock_); + ACE_Guard m ((ACE_LOCK &) this->mutex_); return this->value_ >= i; } @@ -82,7 +82,7 @@ template ACE_INLINE int ACE_Atomic_Op::operator> (const TYPE &rhs) const { // ACE_TRACE ("ACE_Atomic_Op::operator>"); - ACE_Guard m ((ACE_LOCK &) this->lock_); + ACE_Guard m ((ACE_LOCK &) this->mutex_); return this->value_ > rhs; } @@ -90,7 +90,7 @@ template ACE_INLINE int ACE_Atomic_Op::operator<= (const TYPE &rhs) const { // ACE_TRACE ("ACE_Atomic_Op::operator<="); - ACE_Guard m ((ACE_LOCK &) this->lock_); + ACE_Guard m ((ACE_LOCK &) this->mutex_); return this->value_ <= rhs; } @@ -98,7 +98,7 @@ template ACE_INLINE int ACE_Atomic_Op::operator< (const TYPE &rhs) const { // ACE_TRACE ("ACE_Atomic_Op::operator<"); - ACE_Guard m ((ACE_LOCK &) this->lock_); + ACE_Guard m ((ACE_LOCK &) this->mutex_); return this->value_ < rhs; } @@ -108,7 +108,7 @@ ACE_Atomic_Op::operator= (const ACE_Atomic_Op &r // ACE_TRACE ("ACE_Atomic_Op::operator="); if (&rhs == this) return; // Avoid deadlock... - ACE_Guard m (this->lock_); + ACE_Guard m (this->mutex_); // This will call ACE_Atomic_Op::TYPE(), which will ensure the value // of is acquired atomically. @@ -119,7 +119,7 @@ template ACE_INLINE TYPE ACE_Atomic_Op::value (void) const { // ACE_TRACE ("ACE_Atomic_Op::value"); - ACE_Guard m ((ACE_LOCK &) this->lock_); + ACE_Guard m ((ACE_LOCK &) this->mutex_); return this->value_; } @@ -127,7 +127,7 @@ template ACE_INLINE void ACE_Atomic_Op::operator= (const TYPE &i) { // ACE_TRACE ("ACE_Atomic_Op::operator="); - ACE_Guard m (this->lock_); + ACE_Guard m (this->mutex_); this->value_ = i; } diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp index becdb32ebde..a7f1f3c199b 100644 --- a/ace/Proactor.cpp +++ b/ace/Proactor.cpp @@ -421,7 +421,7 @@ ACE_Proactor::schedule_timer (ACE_Handler &handler, ACE_Time_Value absolute_time = this->timer_queue_->gettimeofday () + time; // Only one guy goes in here at a time - ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->timer_queue_->lock (), -1); + ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->timer_queue_->mutex (), -1); // Schedule the timer long result = this->timer_queue_->schedule (&handler, diff --git a/ace/Synch_T.cpp b/ace/Synch_T.cpp index db3eced7f9e..c502b37608d 100644 --- a/ace/Synch_T.cpp +++ b/ace/Synch_T.cpp @@ -54,10 +54,10 @@ ACE_Test_and_Set::handle_signal (int, siginfo_t *, ucontext_t *) } template ACE_LOCK & -ACE_Atomic_Op::lock (void) +ACE_Atomic_Op::mutex (void) { // ACE_TRACE ("ACE_Atomic_Op::lock"); - return this->lock_; + return this->mutex_; } template void @@ -66,7 +66,7 @@ ACE_Atomic_Op::dump (void) const // ACE_TRACE ("ACE_Atomic_Op::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->lock_.dump (); + this->mutex_.dump (); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } @@ -92,7 +92,7 @@ ACE_Guard::dump (void) const // ACE_TRACE ("ACE_Guard::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, "lock_ = %x\n", this->lock_)); + ACE_DEBUG ((LM_DEBUG, "mutex_ = %x\n", this->mutex_)); ACE_DEBUG ((LM_DEBUG, "owner_ = %d\n", this->owner_)); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } diff --git a/ace/Synch_T.h b/ace/Synch_T.h index f6f68a01360..71c624c5c83 100644 --- a/ace/Synch_T.h +++ b/ace/Synch_T.h @@ -205,14 +205,15 @@ public: ACE_Atomic_Op (const ACE_Atomic_Op &); // Manage copying... - ACE_LOCK &lock (void); + ACE_LOCK &mutex (void); // Returns a reference to the underlying . This makes it // possible to acquire the lock explicitly, which can be useful in // some cases *if* you instantiate the with an // . + // NOTE: the right name would be lock_, but HP/C++ will choke on that! private: - ACE_LOCK lock_; + ACE_LOCK mutex_; // Type of synchronization mechanism. TYPE value_; diff --git a/ace/Timer_Heap.cpp b/ace/Timer_Heap.cpp index b0ff8024fc3..4e09bc9bb01 100644 --- a/ace/Timer_Heap.cpp +++ b/ace/Timer_Heap.cpp @@ -9,7 +9,27 @@ #include "ace/Timer_Heap.h" #if defined (ACE_HAS_BROKEN_HPUX_TEMPLATES) +#include "ace/Timer_Hash.h" #include "ace/Timer_Heap_T.cpp" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class + ACE_Timer_Heap_T< + ACE_Event_Handler*, + ACE_Timer_Hash_Upcall< + ACE_Event_Handler*, + ACE_Event_Handler_Handle_Timeout_Upcall, + ACE_Null_Mutex>, + ACE_Null_Mutex>; + +template class + ACE_Timer_Heap_Iterator_T< + ACE_Event_Handler*, + ACE_Timer_Hash_Upcall< + ACE_Event_Handler*, + ACE_Event_Handler_Handle_Timeout_Upcall, + ACE_Null_Mutex>, + ACE_Null_Mutex>; +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ #endif /* ACE_HAS_BROKEN_HPUX_TEMPLATES */ #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/ace/Timer_Heap_T.cpp b/ace/Timer_Heap_T.cpp index 21eb29694ed..d94df1c2ecf 100644 --- a/ace/Timer_Heap_T.cpp +++ b/ace/Timer_Heap_T.cpp @@ -520,7 +520,7 @@ ACE_Timer_Heap_T::schedule (const TYPE &type, { ACE_TRACE ("ACE_Timer_Heap::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)); if (this->cur_size_ < this->max_size_) { @@ -557,7 +557,7 @@ ACE_Timer_Heap_T::cancel (long timer_id, int dont_call) { ACE_TRACE ("ACE_Timer_Heap::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)); // Locate the ACE_Timer_Node that corresponds to the timer_id. @@ -598,7 +598,7 @@ ACE_Timer_Heap_T::cancel (const TYPE &type, int dont_call) { ACE_TRACE ("ACE_Timer_Heap::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)); int number_of_cancellations = 0; diff --git a/ace/Timer_List.cpp b/ace/Timer_List.cpp index 10ab73d198b..4fe5d67ee70 100644 --- a/ace/Timer_List.cpp +++ b/ace/Timer_List.cpp @@ -9,7 +9,28 @@ #include "ace/Timer_List.h" #if defined (ACE_HAS_BROKEN_HPUX_TEMPLATES) +#include "ace/Timer_Hash.h" #include "ace/Timer_List_T.cpp" + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class + ACE_Timer_List_T< + ACE_Event_Handler*, + ACE_Timer_Hash_Upcall< + ACE_Event_Handler*, + ACE_Event_Handler_Handle_Timeout_Upcall, + ACE_Null_Mutex>, + ACE_Null_Mutex>; + +template class +ACE_Timer_List_Iterator_T< + ACE_Event_Handler*, + ACE_Timer_Hash_Upcall< + ACE_Event_Handler*, + ACE_Event_Handler_Handle_Timeout_Upcall, + ACE_Null_Mutex>, + ACE_Null_Mutex>; +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ #endif /* ACE_HAS_BROKEN_HPUX_TEMPLATES */ #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/ace/Timer_Queue.cpp b/ace/Timer_Queue.cpp index 8a313ce3d3a..960cee1d4e4 100644 --- a/ace/Timer_Queue.cpp +++ b/ace/Timer_Queue.cpp @@ -10,7 +10,28 @@ #include "ace/Timer_Queue.h" #if defined (ACE_HAS_BROKEN_HPUX_TEMPLATES) +#include "ace/Timer_Hash.h" #include "ace/Timer_Queue_T.cpp" + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class + ACE_Timer_Queue_T< + ACE_Event_Handler*, + ACE_Timer_Hash_Upcall< + ACE_Event_Handler*, + ACE_Event_Handler_Handle_Timeout_Upcall, + ACE_Null_Mutex>, + ACE_Null_Mutex>; + +template class + ACE_Timer_Queue_Iterator_T< + ACE_Event_Handler*, + ACE_Timer_Hash_Upcall< + ACE_Event_Handler*, + ACE_Event_Handler_Handle_Timeout_Upcall, + ACE_Null_Mutex>, + ACE_Null_Mutex>; +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ #endif /* ACE_HAS_BROKEN_HPUX_TEMPLATES */ #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/ace/Timer_Queue_Adapters.cpp b/ace/Timer_Queue_Adapters.cpp index 97dc02704eb..bef4d4af92b 100644 --- a/ace/Timer_Queue_Adapters.cpp +++ b/ace/Timer_Queue_Adapters.cpp @@ -149,9 +149,9 @@ ACE_Thread_Timer_Queue_Adapter::ACE_Thread_Timer_Queue_Adapter (ACE_Thread_M } template ACE_SYNCH_MUTEX & -ACE_Thread_Timer_Queue_Adapter::lock (void) +ACE_Thread_Timer_Queue_Adapter::mutex (void) { - return this->lock_; + return this->mutex_; } template long diff --git a/ace/Timer_Queue_Adapters.h b/ace/Timer_Queue_Adapters.h index 60fb48b894d..13f7ab5198a 100644 --- a/ace/Timer_Queue_Adapters.h +++ b/ace/Timer_Queue_Adapters.h @@ -115,7 +115,7 @@ public: virtual void deactivate (void); // Inform the dispatching thread that it should terminate. - ACE_SYNCH_MUTEX &lock (void); + ACE_SYNCH_MUTEX &mutex (void); // Access the locking mechanism, useful for iteration. TQ &timer_queue (void); @@ -144,7 +144,7 @@ private: // dispatch the next timer; it is used to wake it up if there is a // change on the timer queue. - ACE_SYNCH_MUTEX lock_; + ACE_SYNCH_MUTEX mutex_; // The mutual exclusion mechanism which is required to use the // . diff --git a/ace/Timer_Queue_T.cpp b/ace/Timer_Queue_T.cpp index 2b39d76bf02..bd337f47364 100644 --- a/ace/Timer_Queue_T.cpp +++ b/ace/Timer_Queue_T.cpp @@ -54,7 +54,7 @@ template ACE_Time_Value * ACE_Timer_Queue_T::calculate_timeout (ACE_Time_Value *max_wait_time) { ACE_TRACE ("ACE_Timer_Queue_T::calculate_timeout"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, max_wait_time)); + ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, max_wait_time)); if (this->is_empty ()) // Nothing on the Timer_Queue, so use whatever the caller gave us. @@ -179,9 +179,9 @@ ACE_Timer_Queue_T::free_node (ACE_Timer_Node_T *n } template ACE_LOCK & -ACE_Timer_Queue_T::lock (void) +ACE_Timer_Queue_T::mutex (void) { - return this->lock_; + return this->mutex_; } // Run the method for all Timers whose values are <= @@ -191,7 +191,7 @@ template int ACE_Timer_Queue_T::expire (const ACE_Time_Value &cur_time) { ACE_TRACE ("ACE_Timer_Queue_T::expire"); - ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1)); + ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); int number_of_timers_expired = 0; diff --git a/ace/Timer_Queue_T.h b/ace/Timer_Queue_T.h index d4ba48a8dba..b4079123eae 100644 --- a/ace/Timer_Queue_T.h +++ b/ace/Timer_Queue_T.h @@ -254,7 +254,7 @@ public: void timer_skew (const ACE_Time_Value &skew); const ACE_Time_Value &timer_skew (void) const; - ACE_LOCK &lock (void); + ACE_LOCK &mutex (void); // Synchronization variable used by the queue FUNCTOR &upcall_functor (void); @@ -285,8 +285,9 @@ protected: virtual void free_node (ACE_Timer_Node_T *); // Factory method that frees a previously allocated node. - ACE_LOCK lock_; + ACE_LOCK mutex_; // Synchronization variable for . + // NOTE: the right name would be lock_, but HP/C++ will choke on that! ACE_Free_List > *free_list_; // Class that implements a free list -- cgit v1.2.1