diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-08-06 01:41:15 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-08-06 01:41:15 +0000 |
commit | 2e9ec10b4dd58471a90c3a185e9db8886200282d (patch) | |
tree | d9b4cb8bc6e1b8bd28331de8e5d44ec5d1cd707d | |
parent | 0e8ddecfe3f32c831ae2dc434590e3f84b7d8262 (diff) | |
download | ATCD-2e9ec10b4dd58471a90c3a185e9db8886200282d.tar.gz |
*** empty log message ***
-rw-r--r-- | ace/Containers.cpp | 8 | ||||
-rw-r--r-- | ace/Containers.h | 3 | ||||
-rw-r--r-- | ace/Message_Queue.cpp | 40 | ||||
-rw-r--r-- | ace/Message_Queue.h | 10 | ||||
-rw-r--r-- | ace/OS.h | 4 | ||||
-rw-r--r-- | ace/README | 1 | ||||
-rw-r--r-- | ace/Synch_T.h | 8 |
7 files changed, 43 insertions, 31 deletions
diff --git a/ace/Containers.cpp b/ace/Containers.cpp index 1aa28d273d6..384d430c5a1 100644 --- a/ace/Containers.cpp +++ b/ace/Containers.cpp @@ -1087,6 +1087,14 @@ ACE_Unbounded_Set<T>::insert_tail (const T &item) } template <class T> void +ACE_Unbounded_Set<T>::reset (void) +{ + ACE_TRACE ("reset"); + + this->delete_nodes (); +} + +template <class T> void ACE_Unbounded_Set<T>::dump (void) const { ACE_TRACE ("ACE_Unbounded_Set<T>::dump"); diff --git a/ace/Containers.h b/ace/Containers.h index e0fe188f753..9e08f3bb411 100644 --- a/ace/Containers.h +++ b/ace/Containers.h @@ -541,6 +541,9 @@ public: void dump (void) const; // Dump the state of an object. + void reset (void); + // Reset the <ACE_Unbounded_Set> to be empty. + ACE_ALLOC_HOOK_DECLARE; // Declare the dynamic allocation hooks. diff --git a/ace/Message_Queue.cpp b/ace/Message_Queue.cpp index 7b31c53d358..ebffb72a842 100644 --- a/ace/Message_Queue.cpp +++ b/ace/Message_Queue.cpp @@ -132,7 +132,7 @@ template <ACE_SYNCH_1> ACE_Message_Queue<ACE_SYNCH_2>::ACE_Message_Queue (size_t hwm, size_t lwm, ACE_Notification_Strategy *ns) -#if defined (ACE_LACKS_COND_T) +#if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) : not_empty_cond_ (0), not_full_cond_ (0), enqueue_waiters_ (0), @@ -140,7 +140,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::ACE_Message_Queue (size_t hwm, #else : not_empty_cond_ (this->lock_), not_full_cond_ (this->lock_) -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ { ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::ACE_Message_Queue"); @@ -188,10 +188,10 @@ ACE_Message_Queue<ACE_SYNCH_2>::deactivate_i (void) this->deactivated_ ? WAS_INACTIVE : WAS_ACTIVE; // Wakeup all waiters. -#if !defined (ACE_LACKS_COND_T) +#if !defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) this->not_empty_cond_.broadcast (); this->not_full_cond_.broadcast (); -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ this->deactivated_ = 1; return current_status; @@ -278,7 +278,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_tail_i (ACE_Message_Block *new_item) this->cur_bytes_ += temp->size (); this->cur_count_++; -#if !defined (ACE_LACKS_COND_T) +#if !defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) // Tell any blocked threads that the queue has a new item! if (this->not_empty_cond_.signal () != 0) return -1; @@ -288,7 +288,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_tail_i (ACE_Message_Block *new_item) --this->dequeue_waiters_; this->not_empty_cond_.release (); } -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ return this->cur_count_; } @@ -320,7 +320,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_head_i (ACE_Message_Block *new_item) this->cur_bytes_ += temp->size (); this->cur_count_++; -#if !defined (ACE_LACKS_COND_T) +#if !defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) // Tell any blocked threads that the queue has a new item! if (this->not_empty_cond_.signal () != 0) return -1; @@ -330,7 +330,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_head_i (ACE_Message_Block *new_item) --this->dequeue_waiters_; this->not_empty_cond_.release (); } -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ return this->cur_count_; } @@ -398,7 +398,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_i (ACE_Message_Block *new_item) this->cur_bytes_ += temp->size (); this->cur_count_++; -#if !defined (ACE_LACKS_COND_T) +#if !defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) // Tell any blocked threads that the queue has a new item! if (this->not_empty_cond_.signal () != 0) return -1; @@ -408,7 +408,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_i (ACE_Message_Block *new_item) --this->dequeue_waiters_; this->not_empty_cond_.release (); } -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ return this->cur_count_; } @@ -439,7 +439,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::dequeue_head_i (ACE_Message_Block *&first_item) this->cur_count_--; -#if !defined (ACE_LACKS_COND_T) +#if !defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) if (this->not_full_cond_.signal () != 0) return -1; #else @@ -448,7 +448,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::dequeue_head_i (ACE_Message_Block *&first_item) --this->enqueue_waiters_; this->not_full_cond_.release (); } -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ return this->cur_count_; } @@ -504,7 +504,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_head (ACE_Message_Block *new_item, return -1; } -#if defined (ACE_LACKS_COND_T) +#if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) if (this->is_full_i ()) { ++this->enqueue_waiters_; @@ -530,7 +530,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_head (ACE_Message_Block *new_item, return -1; } } -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ int queue_count = this->enqueue_head_i (new_item); @@ -560,7 +560,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_prio (ACE_Message_Block *new_item, return -1; } -#if defined (ACE_LACKS_COND_T) +#if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) if (this->is_full_i ()) { ++this->enqueue_waiters_; @@ -586,7 +586,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_prio (ACE_Message_Block *new_item, return -1; } } -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ int queue_count = this->enqueue_i (new_item); @@ -623,7 +623,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_tail (ACE_Message_Block *new_item, return -1; } -#if defined (ACE_LACKS_COND_T) +#if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) if (this->is_full_i ()) { ++this->enqueue_waiters_; @@ -649,7 +649,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_tail (ACE_Message_Block *new_item, return -1; } } -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ int queue_count = this->enqueue_tail_i (new_item); @@ -679,7 +679,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::dequeue_head (ACE_Message_Block *&first_item, return -1; } -#if defined (ACE_LACKS_COND_T) +#if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) if (this->is_empty_i ()) { ++this->dequeue_waiters_; @@ -705,7 +705,7 @@ ACE_Message_Queue<ACE_SYNCH_2>::dequeue_head (ACE_Message_Block *&first_item, return -1; } } -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ return this->dequeue_head_i (first_item); } diff --git a/ace/Message_Queue.h b/ace/Message_Queue.h index 0deac33536c..b9363d2690b 100644 --- a/ace/Message_Queue.h +++ b/ace/Message_Queue.h @@ -14,8 +14,8 @@ // // ============================================================================ -#if !defined (ACE_MESSAGE_LIST_H) -#define ACE_MESSAGE_LIST_H +#if !defined (ACE_MESSAGE_QUEUE_H) +#define ACE_MESSAGE_QUEUE_H #include "ace/Message_Block.h" #include "ace/IO_Cntl_Msg.h" @@ -236,7 +236,7 @@ protected: ACE_SYNCH_MUTEX_T lock_; // Protect queue from concurrent access. -#if defined (ACE_LACKS_COND_T) +#if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) ACE_SYNCH_SEMAPHORE_T not_empty_cond_; // Used to make threads sleep until the queue is no longer empty. @@ -254,7 +254,7 @@ protected: ACE_SYNCH_CONDITION_T not_full_cond_; // Used to make threads sleep until the queue is no longer full. -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ }; template <ACE_SYNCH_1> @@ -342,4 +342,4 @@ private: #pragma implementation ("Message_Queue.cpp") #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ -#endif /* ACE_MESSAGE_LIST_H */ +#endif /* ACE_MESSAGE_QUEUE_H */ @@ -804,13 +804,13 @@ private: #else /* TEMPLATES are broken in some form or another (i.e., most C++ compilers) */ // Handle ACE_Message_Queue. -#if defined (ACE_LACKS_COND_T) +#if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) #define ACE_SYNCH_1 class _ACE_SYNCH_MUTEX_T, class _ACE_SYNCH_SEMAPHORE_T #define ACE_SYNCH_2 _ACE_SYNCH_MUTEX_T, _ACE_SYNCH_SEMAPHORE_T #else #define ACE_SYNCH_1 class _ACE_SYNCH_MUTEX_T, class _ACE_SYNCH_CONDITION_T #define ACE_SYNCH_2 _ACE_SYNCH_MUTEX_T, _ACE_SYNCH_CONDITION_T -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ #define ACE_SYNCH_MUTEX_T _ACE_SYNCH_MUTEX_T #define ACE_SYNCH_CONDITION_T _ACE_SYNCH_CONDITION_T #define ACE_SYNCH_SEMAPHORE_T _ACE_SYNCH_SEMAPHORE_T diff --git a/ace/README b/ace/README index a8f390ecc75..74b49b1c3b4 100644 --- a/ace/README +++ b/ace/README @@ -85,6 +85,7 @@ ACE_HAS_OLD_MALLOC Compiler/platform uses old malloc()/free() prototypes (ugh) ACE_HAS_ONEARG_SIGWAIT sigwait() takes only one argument. ACE_HAS_ONLY_SCHED_OTHER Platform, e.g., Solaris 2.5, only supports SCHED_OTHER POSIX scheduling policy. ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R Uses ctime_r & asctime_r with only two parameters vs. three. +ACE_HAS_OPTIMIZED_MESSAGE_QUEUE Use the semaphore implementation of ACE_Message_Queue rather than the emulated condition variable (NT and VxWorks). ACE_HAS_ORBIX Platform has Orbix CORBA implementation ACE_HAS_OSF_TIMOD_H Platform supports the OSF TLI timod STREAMS module ACE_HAS_PENTIUM Platform is an Intel Pentium microprocessor. diff --git a/ace/Synch_T.h b/ace/Synch_T.h index 1e5a0058562..3671862ad17 100644 --- a/ace/Synch_T.h +++ b/ace/Synch_T.h @@ -295,11 +295,11 @@ public: // "Do-nothing" Condition type. }; #else /* Necessary to support broken cfront-based C++ compilers... */ -#if defined (ACE_LACKS_COND_T) +#if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) #define ACE_NULL_SYNCH ACE_Null_Mutex, ACE_Null_Mutex, #else #define ACE_NULL_SYNCH ACE_Null_Mutex, ACE_Null_Condition_Mutex -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ #endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ template <class ACE_LOCK> @@ -736,11 +736,11 @@ public: #define ACE_SYNCH_NULL_SEMAPHORE ACE_MT_SYNCH::NULL_SEMAPHORE #define ACE_SYNCH_SEMAPHORE ACE_MT_SYNCH::SEMAPHORE #else /* Necessary to support broken cfront-based C++ compilers... */ -#if defined (ACE_LACKS_COND_T) +#if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) #define ACE_MT_SYNCH ACE_Thread_Mutex, ACE_Thread_Semaphore #else #define ACE_MT_SYNCH ACE_Thread_Mutex, ACE_Condition_Thread_Mutex -#endif /* ACE_LACKS_COND_T */ +#endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ #define ACE_SYNCH_MUTEX ACE_Thread_Mutex #define ACE_SYNCH_NULL_MUTEX ACE_Null_Mutex; #define ACE_SYNCH_PROCESS_MUTEX ACE_Process_Mutex; |