diff options
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Addr.cpp | 2 | ||||
-rw-r--r-- | ace/DEV_Addr.cpp | 21 | ||||
-rw-r--r-- | ace/DEV_Addr.h | 3 | ||||
-rw-r--r-- | ace/FILE_Addr.cpp | 75 | ||||
-rw-r--r-- | ace/FILE_Addr.h | 3 | ||||
-rw-r--r-- | ace/FILE_Addr.i | 65 | ||||
-rw-r--r-- | ace/INET_Addr.cpp | 20 | ||||
-rw-r--r-- | ace/Message_Queue.cpp | 164 | ||||
-rw-r--r-- | ace/Message_Queue.h | 28 | ||||
-rw-r--r-- | ace/Message_Queue.i | 84 | ||||
-rw-r--r-- | ace/Module.cpp | 80 | ||||
-rw-r--r-- | ace/Module.h | 32 | ||||
-rw-r--r-- | ace/Module.i | 48 | ||||
-rw-r--r-- | ace/OS.h | 13 | ||||
-rw-r--r-- | ace/OS.i | 21 | ||||
-rw-r--r-- | ace/SPIPE_Addr.cpp | 35 | ||||
-rw-r--r-- | ace/SPIPE_Addr.h | 3 | ||||
-rw-r--r-- | ace/Stream.cpp | 200 | ||||
-rw-r--r-- | ace/Stream.h | 50 | ||||
-rw-r--r-- | ace/Stream.i | 36 | ||||
-rw-r--r-- | ace/Stream_Modules.cpp | 204 | ||||
-rw-r--r-- | ace/Stream_Modules.h | 12 | ||||
-rw-r--r-- | ace/Svc_Handler.cpp | 144 | ||||
-rw-r--r-- | ace/Svc_Handler.h | 6 | ||||
-rw-r--r-- | ace/Synch_T.h | 2 | ||||
-rw-r--r-- | ace/Task_T.cpp | 40 | ||||
-rw-r--r-- | ace/Task_T.h | 26 | ||||
-rw-r--r-- | ace/Task_T.i | 72 | ||||
-rw-r--r-- | ace/UNIX_Addr.cpp | 24 |
29 files changed, 785 insertions, 728 deletions
diff --git a/ace/Addr.cpp b/ace/Addr.cpp index 36d73803c5c..f91971a4c3b 100644 --- a/ace/Addr.cpp +++ b/ace/Addr.cpp @@ -5,7 +5,7 @@ #include "ace/Addr.h" // This is a static class variable. -const ACE_Addr ACE_Addr::sap_any (-1, -1); +const ACE_Addr ACE_Addr::sap_any (AF_ANY, -1); #if !defined (__ACE_INLINE__) #include "ace/Addr.i" diff --git a/ace/DEV_Addr.cpp b/ace/DEV_Addr.cpp index de93fb655e3..67f8d3611fd 100644 --- a/ace/DEV_Addr.cpp +++ b/ace/DEV_Addr.cpp @@ -31,16 +31,29 @@ ACE_DEV_Addr::ACE_DEV_Addr (void) 0, sizeof this->devname_); } +int +ACE_DEV_Addr::set (const ACE_DEV_Addr &sa) +{ + this->base_set (sa.get_type (), sa.get_size ()); + + if (sa.get_type () == AF_ANY) + (void) ACE_OS::memset ((void *) &this->devname_, + 0, + sizeof this->devname_); + else + (void) ACE_OS::memcpy ((void *) &this->devname_, + (void *) &sa.devname_, + sa.get_size ()); + return 0; +} + // Copy constructor. ACE_DEV_Addr::ACE_DEV_Addr (const ACE_DEV_Addr &sa) - : ACE_Addr (AF_DEV, ACE_OS::strlen (this->devname_)) { ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr"); - (void) ACE_OS::memcpy ((void *) &this->devname_, - (void *) &sa.devname_, - sa.get_size ()); + this->set (sa); } ACE_DEV_Addr::ACE_DEV_Addr (LPCTSTR devname) diff --git a/ace/DEV_Addr.h b/ace/DEV_Addr.h index b1b06a810a5..4ea35c1115a 100644 --- a/ace/DEV_Addr.h +++ b/ace/DEV_Addr.h @@ -33,6 +33,9 @@ public: ACE_DEV_Addr (const ACE_DEV_Addr &sa); // Copy constructor. + int set (const ACE_DEV_Addr &sa); + // Acts like a copy constructor. + ACE_DEV_Addr (LPCTSTR devname); // Create a ACE_DEV_Addr from a device name. diff --git a/ace/FILE_Addr.cpp b/ace/FILE_Addr.cpp index 4d7c06f4553..153eb366b3f 100644 --- a/ace/FILE_Addr.cpp +++ b/ace/FILE_Addr.cpp @@ -10,6 +10,81 @@ ACE_ALLOC_HOOK_DEFINE(ACE_FILE_Addr) +ACE_FILE_Addr::ACE_FILE_Addr (void) + : ACE_Addr (AF_FILE, sizeof this->filename_) +{ + (void) ACE_OS::memset ((void *) &this->filename_, + 0, + sizeof this->filename_); +} + +ACE_FILE_Addr::set (const ACE_FILE_Addr &sa) +{ + this->base_set (sa.get_type (), sa.get_size ()); + + if (sa.get_type () == AF_ANY) + (void) ACE_OS::memset ((void *) &this->filename_, + 0, + sizeof this->filename_); + else + (void) ACE_OS::memcpy ((void *) &this->filename_, + (void *) &sa.filename_, + sa.get_size ()); +} + +// Copy constructor. + +ACE_FILE_Addr::ACE_FILE_Addr (const ACE_FILE_Addr &sa) +{ + this->set (sa); +} + +ACE_FILE_Addr & +ACE_FILE_Addr::operator= (const ACE_FILE_Addr &sa) +{ + if (this != &sa) + (void) ACE_OS::memcpy ((void *) &this->filename_, + (void *) &sa.filename_, + sa.get_size ()); + return *this; +} + +void +ACE_FILE_Addr::set (LPCTSTR filename) +{ + this->ACE_Addr::base_set (AF_FILE, + ACE_OS::strlen (filename) ); + (void) ACE_OS::strcpy (this->filename_, + filename); +} + +// Create a ACE_Addr from a ACE_FILE pathname. + +ACE_FILE_Addr::ACE_FILE_Addr (LPCTSTR filename) +{ + this->set (filename); +} + +// Transform the current address into string format. + +#if defined (UNICODE) +int +ACE_FILE_Addr::addr_to_string (wchar_t * s, size_t len) const +{ + ACE_OS::strncpy (s, this->filename_, len); + return 0; +} +#endif /* UNICODE */ + +int +ACE_FILE_Addr::addr_to_string (char *s, size_t len) const +{ + ACE_OS::strncpy (s, + ACE_MULTIBYTE_STRING (this->filename_), + len); + return 0; +} + void ACE_FILE_Addr::dump (void) const { diff --git a/ace/FILE_Addr.h b/ace/FILE_Addr.h index 733dcf08f69..30bfda9ab3a 100644 --- a/ace/FILE_Addr.h +++ b/ace/FILE_Addr.h @@ -33,6 +33,9 @@ public: ACE_FILE_Addr (const ACE_FILE_Addr &sa); // Copy constructor. + int set (const ACE_FILE_Addr &sa); + // Acts like a copy constructor. + ACE_FILE_Addr (LPCTSTR filename); // Create a ACE_FILE_Addr from a pathname. diff --git a/ace/FILE_Addr.i b/ace/FILE_Addr.i index b1f3aeb78c8..6d23f13a41b 100644 --- a/ace/FILE_Addr.i +++ b/ace/FILE_Addr.i @@ -9,70 +9,6 @@ #include "ace/SString.h" -ACE_INLINE -ACE_FILE_Addr::ACE_FILE_Addr (void) - : ACE_Addr (AF_FILE, sizeof this->filename_) -{ - (void) ACE_OS::memset ((void *) &this->filename_, - 0, sizeof this->filename_); -} - -// Copy constructor. - -ACE_INLINE -ACE_FILE_Addr::ACE_FILE_Addr (const ACE_FILE_Addr &sa) - : ACE_Addr (AF_FILE, ACE_OS::strlen (sa.filename_)) -{ - (void) ACE_OS::memcpy ((void *) &this->filename_, - (void *) &sa.filename_, sa.get_size ()); -} - -ACE_INLINE ACE_FILE_Addr & -ACE_FILE_Addr::operator= (const ACE_FILE_Addr &sa) -{ - if (this != &sa) - (void) ACE_OS::memcpy ((void *) &this->filename_, - (void *) &sa.filename_, - sa.get_size ()); - return *this; -} - -ACE_INLINE void -ACE_FILE_Addr::set (LPCTSTR filename) -{ - - this->ACE_Addr::base_set (AF_FILE, ACE_OS::strlen (filename) ); - (void) ACE_OS::strcpy (this->filename_, filename); -} - -// Create a ACE_Addr from a ACE_FILE pathname. - -ACE_INLINE -ACE_FILE_Addr::ACE_FILE_Addr (LPCTSTR filename) -{ - this->set (filename); -} - -// Transform the current address into string format. - -#if defined (UNICODE) -ACE_INLINE int -ACE_FILE_Addr::addr_to_string (wchar_t * s, size_t len) const -{ - ACE_OS::strncpy (s, this->filename_, len); - return 0; -} -#endif /* UNICODE */ - -ACE_INLINE int -ACE_FILE_Addr::addr_to_string (char *s, size_t len) const -{ - ACE_OS::strncpy (s, - ACE_MULTIBYTE_STRING (this->filename_), - len); - return 0; -} - // Return the address. ACE_INLINE void * @@ -104,3 +40,4 @@ ACE_FILE_Addr::get_path_name (void) const { return this->filename_; } + diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp index 36ad5bca409..bd7bff4a61d 100644 --- a/ace/INET_Addr.cpp +++ b/ace/INET_Addr.cpp @@ -66,7 +66,8 @@ ACE_INET_Addr::ACE_INET_Addr (void) : ACE_Addr (AF_INET, sizeof this->inet_addr_) { // ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr"); - (void) ACE_OS::memset ((void *) &this->inet_addr_, 0, + (void) ACE_OS::memset ((void *) &this->inet_addr_, + 0, sizeof this->inet_addr_); } @@ -74,10 +75,19 @@ int ACE_INET_Addr::set (const ACE_INET_Addr &sa) { ACE_TRACE ("ACE_INET_Addr::set"); - this->ACE_Addr::base_set (AF_INET, sizeof this->inet_addr_); - (void) ACE_OS::memcpy ((void *) &this->inet_addr_, - (void *) &sa.inet_addr_, - sizeof this->inet_addr_); + + this->ACE_Addr::base_set (sa.get_type (), sa.get_size ()); + + if (sa.get_type () == AF_ANY) + // Ugh, this is really a base class, so don't copy it. + (void) ACE_OS::memset ((void *) &this->inet_addr_, + 0, + sizeof this->inet_addr_); + else + // It's ok to make the copy. + (void) ACE_OS::memcpy ((void *) &this->inet_addr_, + (void *) &sa.inet_addr_, + sizeof this->inet_addr_); return 0; } diff --git a/ace/Message_Queue.cpp b/ace/Message_Queue.cpp index 617bdb8931c..431cc4b77c5 100644 --- a/ace/Message_Queue.cpp +++ b/ace/Message_Queue.cpp @@ -13,15 +13,15 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Message_Queue) -template <ACE_SYNCH_1> -ACE_Message_Queue_Iterator<ACE_SYNCH_2>::ACE_Message_Queue_Iterator (ACE_Message_Queue <ACE_SYNCH_2> &queue) +template <ACE_SYNCH_DECL> +ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::ACE_Message_Queue_Iterator (ACE_Message_Queue <ACE_SYNCH_USE> &queue) : queue_ (queue), curr_ (queue_.head_) { } -template <ACE_SYNCH_1> int -ACE_Message_Queue_Iterator<ACE_SYNCH_2>::next (ACE_Message_Block *&entry) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::next (ACE_Message_Block *&entry) { ACE_Read_Guard<ACE_SYNCH_MUTEX_T> m (this->queue_.lock_); @@ -34,16 +34,16 @@ ACE_Message_Queue_Iterator<ACE_SYNCH_2>::next (ACE_Message_Block *&entry) return 0; } -template <ACE_SYNCH_1> int -ACE_Message_Queue_Iterator<ACE_SYNCH_2>::done (void) const +template <ACE_SYNCH_DECL> int +ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::done (void) const { ACE_Read_Guard<ACE_SYNCH_MUTEX_T> m (this->queue_.lock_); return this->curr_ == 0; } -template <ACE_SYNCH_1> int -ACE_Message_Queue_Iterator<ACE_SYNCH_2>::advance (void) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::advance (void) { ACE_Read_Guard<ACE_SYNCH_MUTEX_T> m (this->queue_.lock_); @@ -51,22 +51,22 @@ ACE_Message_Queue_Iterator<ACE_SYNCH_2>::advance (void) return this->curr_ != 0; } -template <ACE_SYNCH_1> void -ACE_Message_Queue_Iterator<ACE_SYNCH_2>::dump (void) const +template <ACE_SYNCH_DECL> void +ACE_Message_Queue_Iterator<ACE_SYNCH_USE>::dump (void) const { } ACE_ALLOC_HOOK_DEFINE(ACE_Message_Queue_Iterator) -template <ACE_SYNCH_1> -ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2>::ACE_Message_Queue_Reverse_Iterator (ACE_Message_Queue <ACE_SYNCH_2> &queue) +template <ACE_SYNCH_DECL> +ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::ACE_Message_Queue_Reverse_Iterator (ACE_Message_Queue <ACE_SYNCH_USE> &queue) : queue_ (queue), curr_ (queue_.tail_) { } -template <ACE_SYNCH_1> int -ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2>::next (ACE_Message_Block *&entry) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::next (ACE_Message_Block *&entry) { ACE_Read_Guard<ACE_SYNCH_MUTEX_T> m (this->queue_.lock_); @@ -79,16 +79,16 @@ ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2>::next (ACE_Message_Block *&entry return 0; } -template <ACE_SYNCH_1> int -ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2>::done (void) const +template <ACE_SYNCH_DECL> int +ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::done (void) const { ACE_Read_Guard<ACE_SYNCH_MUTEX_T> m (this->queue_.lock_); return this->curr_ == 0; } -template <ACE_SYNCH_1> int -ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2>::advance (void) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::advance (void) { ACE_Read_Guard<ACE_SYNCH_MUTEX_T> m (this->queue_.lock_); @@ -96,15 +96,15 @@ ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2>::advance (void) return this->curr_ != 0; } -template <ACE_SYNCH_1> void -ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2>::dump (void) const +template <ACE_SYNCH_DECL> void +ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>::dump (void) const { } -template <ACE_SYNCH_1> void -ACE_Message_Queue<ACE_SYNCH_2>::dump (void) const +template <ACE_SYNCH_DECL> void +ACE_Message_Queue<ACE_SYNCH_USE>::dump (void) const { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::dump"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, "deactivated = %d\n" @@ -128,8 +128,8 @@ ACE_Message_Queue<ACE_SYNCH_2>::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } -template <ACE_SYNCH_1> -ACE_Message_Queue<ACE_SYNCH_2>::ACE_Message_Queue (size_t hwm, +template <ACE_SYNCH_DECL> +ACE_Message_Queue<ACE_SYNCH_USE>::ACE_Message_Queue (size_t hwm, size_t lwm, ACE_Notification_Strategy *ns) #if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) @@ -142,16 +142,16 @@ ACE_Message_Queue<ACE_SYNCH_2>::ACE_Message_Queue (size_t hwm, not_full_cond_ (this->lock_) #endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::ACE_Message_Queue"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::ACE_Message_Queue"); if (this->open (hwm, lwm, ns) == -1) ACE_ERROR ((LM_ERROR, "open")); } -template <ACE_SYNCH_1> -ACE_Message_Queue<ACE_SYNCH_2>::~ACE_Message_Queue (void) +template <ACE_SYNCH_DECL> +ACE_Message_Queue<ACE_SYNCH_USE>::~ACE_Message_Queue (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::~ACE_Message_Queue"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::~ACE_Message_Queue"); if (this->head_ != 0 && this->close () == -1) ACE_ERROR ((LM_ERROR, "close")); } @@ -160,12 +160,12 @@ ACE_Message_Queue<ACE_SYNCH_2>::~ACE_Message_Queue (void) // once for the same queue, we're in bigger trouble than just // concurrency control! -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::open (size_t hwm, +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::open (size_t hwm, size_t lwm, ACE_Notification_Strategy *ns) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::open"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::open"); this->high_water_mark_ = hwm; this->low_water_mark_ = lwm; this->deactivated_ = 0; @@ -180,10 +180,10 @@ ACE_Message_Queue<ACE_SYNCH_2>::open (size_t hwm, // Implementation of the public deactivate() method // (assumes locks are held). -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::deactivate_i (void) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::deactivate_i (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::deactivate_i"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::deactivate_i"); int current_status = this->deactivated_ ? WAS_INACTIVE : WAS_ACTIVE; @@ -197,10 +197,10 @@ ACE_Message_Queue<ACE_SYNCH_2>::deactivate_i (void) return current_status; } -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::activate_i (void) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::activate_i (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::activate_i"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::activate_i"); int current_status = this->deactivated_ ? WAS_INACTIVE : WAS_ACTIVE; this->deactivated_ = 0; @@ -209,10 +209,10 @@ ACE_Message_Queue<ACE_SYNCH_2>::activate_i (void) // Clean up the queue if we have not already done so! -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::close (void) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::close (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::close"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::close"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); int res = this->deactivate_i (); @@ -242,8 +242,8 @@ ACE_Message_Queue<ACE_SYNCH_2>::close (void) return res; } -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::signal_enqueue_waiters (void) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::signal_enqueue_waiters (void) { #if !defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) if (this->not_full_cond_.signal () != 0) @@ -258,8 +258,8 @@ ACE_Message_Queue<ACE_SYNCH_2>::signal_enqueue_waiters (void) return 0; } -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::signal_dequeue_waiters (void) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::signal_dequeue_waiters (void) { #if !defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) // Tell any blocked threads that the queue has a new item! @@ -278,10 +278,10 @@ ACE_Message_Queue<ACE_SYNCH_2>::signal_dequeue_waiters (void) // Actually put the node at the end (no locking so must be called with // locks held). -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::enqueue_tail_i (ACE_Message_Block *new_item) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_tail_i (ACE_Message_Block *new_item) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::enqueue_tail_i"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_tail_i"); if (new_item == 0) return -1; @@ -320,10 +320,10 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_tail_i (ACE_Message_Block *new_item) // Actually put the node at the head (no locking) -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::enqueue_head_i (ACE_Message_Block *new_item) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head_i (ACE_Message_Block *new_item) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::enqueue_head_i"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head_i"); if (new_item == 0) return -1; @@ -356,10 +356,10 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_head_i (ACE_Message_Block *new_item) // Actually put the node at its proper position relative to its // priority. -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::enqueue_i (ACE_Message_Block *new_item) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_i (ACE_Message_Block *new_item) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::enqueue_i"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_i"); if (new_item == 0) return -1; @@ -426,10 +426,10 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_i (ACE_Message_Block *new_item) // called with locks held). This method assumes that the queue has at // least one item in it when it is called. -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::dequeue_head_i (ACE_Message_Block *&first_item) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i (ACE_Message_Block *&first_item) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::dequeue_head_i"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head_i"); first_item = this->head_; this->head_ = this->head_->next (); @@ -457,11 +457,11 @@ ACE_Message_Queue<ACE_SYNCH_2>::dequeue_head_i (ACE_Message_Block *&first_item) // Take a look at the first item without removing it. -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::peek_dequeue_head (ACE_Message_Block *&first_item, +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::peek_dequeue_head (ACE_Message_Block *&first_item, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::peek_dequeue_head"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::peek_dequeue_head"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); if (this->deactivated_) @@ -491,8 +491,8 @@ ACE_Message_Queue<ACE_SYNCH_2>::peek_dequeue_head (ACE_Message_Block *&first_ite return this->cur_count_; } -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::wait_not_full_cond (ACE_Guard<ACE_SYNCH_MUTEX_T> &mon, +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::wait_not_full_cond (ACE_Guard<ACE_SYNCH_MUTEX_T> &mon, ACE_Time_Value *tv) { #if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) @@ -527,8 +527,8 @@ ACE_Message_Queue<ACE_SYNCH_2>::wait_not_full_cond (ACE_Guard<ACE_SYNCH_MUTEX_T> return 0; } -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::wait_not_empty_cond (ACE_Guard<ACE_SYNCH_MUTEX_T> &mon, +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::wait_not_empty_cond (ACE_Guard<ACE_SYNCH_MUTEX_T> &mon, ACE_Time_Value *tv) { #if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) @@ -566,11 +566,11 @@ ACE_Message_Queue<ACE_SYNCH_2>::wait_not_empty_cond (ACE_Guard<ACE_SYNCH_MUTEX_T // Block indefinitely waiting for an item to arrive, // does not ignore alerts (e.g., signals). -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::enqueue_head (ACE_Message_Block *new_item, +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head (ACE_Message_Block *new_item, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::enqueue_head"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); if (this->deactivated_) @@ -597,11 +597,11 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_head (ACE_Message_Block *new_item, // accordance with its <msg_priority> (0 is lowest priority). Returns // -1 on failure, else the number of items still on the queue. -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::enqueue_prio (ACE_Message_Block *new_item, +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_prio (ACE_Message_Block *new_item, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::enqueue_prio"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_prio"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); if (this->deactivated_) @@ -624,22 +624,22 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_prio (ACE_Message_Block *new_item, } } -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::enqueue (ACE_Message_Block *new_item, +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::enqueue (ACE_Message_Block *new_item, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::enqueue"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue"); return this->enqueue_prio (new_item, tv); } // Block indefinitely waiting for an item to arrive, // does not ignore alerts (e.g., signals). -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::enqueue_tail (ACE_Message_Block *new_item, +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_tail (ACE_Message_Block *new_item, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::enqueue_tail"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_tail"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); if (this->deactivated_) @@ -666,11 +666,11 @@ ACE_Message_Queue<ACE_SYNCH_2>::enqueue_tail (ACE_Message_Block *new_item, // indefinitely (or until an alert occurs). Otherwise, block for upto // the amount of time specified by TV. -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::dequeue_head (ACE_Message_Block *&first_item, +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head (ACE_Message_Block *&first_item, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::dequeue_head"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::dequeue_head"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); if (this->deactivated_) @@ -685,10 +685,10 @@ ACE_Message_Queue<ACE_SYNCH_2>::dequeue_head (ACE_Message_Block *&first_item, return this->dequeue_head_i (first_item); } -template <ACE_SYNCH_1> int -ACE_Message_Queue<ACE_SYNCH_2>::notify (void) +template <ACE_SYNCH_DECL> int +ACE_Message_Queue<ACE_SYNCH_USE>::notify (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::notify"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::notify"); // By default, don't do anything. if (this->notification_strategy_ == 0) diff --git a/ace/Message_Queue.h b/ace/Message_Queue.h index 8cca61124af..f8fd83cc26f 100644 --- a/ace/Message_Queue.h +++ b/ace/Message_Queue.h @@ -22,10 +22,10 @@ // Forward decls. class ACE_Notification_Strategy; -template <ACE_SYNCH_1> class ACE_Message_Queue_Iterator; -template <ACE_SYNCH_1> class ACE_Message_Queue_Reverse_Iterator; +template <ACE_SYNCH_DECL> class ACE_Message_Queue_Iterator; +template <ACE_SYNCH_DECL> class ACE_Message_Queue_Reverse_Iterator; -template <ACE_SYNCH_1> +template <ACE_SYNCH_DECL> class ACE_Message_Queue // = TITLE // A threaded message queueing facility, modeled after the @@ -33,17 +33,17 @@ class ACE_Message_Queue // // = DESCRIPTION // An <ACE_Message_Queue> is the central queueing facility for - // messages in the ASX framework. If <ACE_SYNCH_1> is + // messages in the ASX framework. If <ACE_SYNCH_DECL> is // ACE_MT_SYNCH then all operations are thread-safe. Otherwise, // if it's <ACE_NULL_SYNCH> then there's no locking overhead. { -friend class ACE_Message_Queue_Iterator<ACE_SYNCH_2>; -friend class ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2>; +friend class ACE_Message_Queue_Iterator<ACE_SYNCH_USE>; +friend class ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE>; public: // = Traits - typedef ACE_Message_Queue_Iterator<ACE_SYNCH_2> ITERATOR; - typedef ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_2> REVERSE_ITERATOR; + typedef ACE_Message_Queue_Iterator<ACE_SYNCH_USE> ITERATOR; + typedef ACE_Message_Queue_Reverse_Iterator<ACE_SYNCH_USE> REVERSE_ITERATOR; // = Default high and low water marks. enum @@ -273,14 +273,14 @@ protected: #endif /* ACE_HAS_OPTIMIZED_MESSAGE_QUEUE */ }; -template <ACE_SYNCH_1> +template <ACE_SYNCH_DECL> class ACE_Message_Queue_Iterator // = TITLE // Iterator for the <ACE_Message_Queue>. { public: // = Initialization method. - ACE_Message_Queue_Iterator (ACE_Message_Queue <ACE_SYNCH_2> &queue); + ACE_Message_Queue_Iterator (ACE_Message_Queue <ACE_SYNCH_USE> &queue); // = Iteration methods. int next (ACE_Message_Block *&entry); @@ -301,21 +301,21 @@ public: // Declare the dynamic allocation hooks. private: - ACE_Message_Queue <ACE_SYNCH_2> &queue_; + ACE_Message_Queue <ACE_SYNCH_USE> &queue_; // Message_Queue we are iterating over. ACE_Message_Block *curr_; // Keeps track of how far we've advanced... }; -template <ACE_SYNCH_1> +template <ACE_SYNCH_DECL> class ACE_Message_Queue_Reverse_Iterator // = TITLE // Reverse Iterator for the <ACE_Message_Queue>. { public: // = Initialization method. - ACE_Message_Queue_Reverse_Iterator (ACE_Message_Queue <ACE_SYNCH_2> &queue); + ACE_Message_Queue_Reverse_Iterator (ACE_Message_Queue <ACE_SYNCH_USE> &queue); // = Iteration methods. int next (ACE_Message_Block *&entry); @@ -336,7 +336,7 @@ public: // Declare the dynamic allocation hooks. private: - ACE_Message_Queue <ACE_SYNCH_2> &queue_; + ACE_Message_Queue <ACE_SYNCH_USE> &queue_; // Message_Queue we are iterating over. ACE_Message_Block *curr_; diff --git a/ace/Message_Queue.i b/ace/Message_Queue.i index 02ded2c141a..7c0038f40d7 100644 --- a/ace/Message_Queue.i +++ b/ace/Message_Queue.i @@ -3,46 +3,46 @@ // Message_Queue.i -template <ACE_SYNCH_1> ACE_INLINE ACE_Notification_Strategy * -ACE_Message_Queue<ACE_SYNCH_2>::notification_strategy (void) +template <ACE_SYNCH_DECL> ACE_INLINE ACE_Notification_Strategy * +ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::notification_strategy"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy"); return this->notification_strategy_; } -template <ACE_SYNCH_1> ACE_INLINE void -ACE_Message_Queue<ACE_SYNCH_2>::notification_strategy (ACE_Notification_Strategy *s) +template <ACE_SYNCH_DECL> ACE_INLINE void +ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy (ACE_Notification_Strategy *s) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::notification_strategy"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::notification_strategy"); this->notification_strategy_ = s; } // Check if queue is empty (does not hold locks). -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Message_Queue<ACE_SYNCH_2>::is_empty_i (void) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Message_Queue<ACE_SYNCH_USE>::is_empty_i (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::is_empty_i"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_empty_i"); return this->cur_bytes_ <= 0 && this->cur_count_ <= 0; } // Check if queue is full (does not hold locks). -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Message_Queue<ACE_SYNCH_2>::is_full_i (void) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Message_Queue<ACE_SYNCH_USE>::is_full_i (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::is_full_i"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_full_i"); return this->cur_bytes_ > this->high_water_mark_; } // Check if queue is empty (holds locks). -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Message_Queue<ACE_SYNCH_2>::is_empty (void) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Message_Queue<ACE_SYNCH_USE>::is_empty (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::is_empty"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_empty"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->is_empty_i (); @@ -50,46 +50,46 @@ ACE_Message_Queue<ACE_SYNCH_2>::is_empty (void) // Check if queue is full (holds locks). -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Message_Queue<ACE_SYNCH_2>::is_full (void) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Message_Queue<ACE_SYNCH_USE>::is_full (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::is_full"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_full"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->is_full_i (); } -template <ACE_SYNCH_1> ACE_INLINE size_t -ACE_Message_Queue<ACE_SYNCH_2>::high_water_mark (void) +template <ACE_SYNCH_DECL> ACE_INLINE size_t +ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::high_water_mark"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0); return this->high_water_mark_; } -template <ACE_SYNCH_1> ACE_INLINE void -ACE_Message_Queue<ACE_SYNCH_2>::high_water_mark (size_t hwm) +template <ACE_SYNCH_DECL> ACE_INLINE void +ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark (size_t hwm) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::high_water_mark"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::high_water_mark"); ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_); this->high_water_mark_ = hwm; } -template <ACE_SYNCH_1> ACE_INLINE size_t -ACE_Message_Queue<ACE_SYNCH_2>::low_water_mark (void) +template <ACE_SYNCH_DECL> ACE_INLINE size_t +ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::low_water_mark"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0); return this->low_water_mark_; } -template <ACE_SYNCH_1> ACE_INLINE void -ACE_Message_Queue<ACE_SYNCH_2>::low_water_mark (size_t lwm) +template <ACE_SYNCH_DECL> ACE_INLINE void +ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark (size_t lwm) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::low_water_mark"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::low_water_mark"); ACE_GUARD (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_); this->low_water_mark_ = lwm; @@ -97,10 +97,10 @@ ACE_Message_Queue<ACE_SYNCH_2>::low_water_mark (size_t lwm) // Return the current number of bytes in the queue. -template <ACE_SYNCH_1> ACE_INLINE size_t -ACE_Message_Queue<ACE_SYNCH_2>::message_bytes (void) +template <ACE_SYNCH_DECL> ACE_INLINE size_t +ACE_Message_Queue<ACE_SYNCH_USE>::message_bytes (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::message_bytes"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_bytes"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0); return this->cur_bytes_; @@ -108,28 +108,28 @@ ACE_Message_Queue<ACE_SYNCH_2>::message_bytes (void) // Return the current number of messages in the queue. -template <ACE_SYNCH_1> ACE_INLINE size_t -ACE_Message_Queue<ACE_SYNCH_2>::message_count (void) +template <ACE_SYNCH_DECL> ACE_INLINE size_t +ACE_Message_Queue<ACE_SYNCH_USE>::message_count (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::message_count"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::message_count"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, 0); return this->cur_count_; } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Message_Queue<ACE_SYNCH_2>::activate (void) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Message_Queue<ACE_SYNCH_USE>::activate (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::activate"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::activate"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->activate_i (); } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Message_Queue<ACE_SYNCH_2>::deactivate (void) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Message_Queue<ACE_SYNCH_USE>::deactivate (void) { - ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_2>::deactivate"); + ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::deactivate"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->deactivate_i (); diff --git a/ace/Module.cpp b/ace/Module.cpp index 72d8fdff41f..93fe1d8b84a 100644 --- a/ace/Module.cpp +++ b/ace/Module.cpp @@ -14,17 +14,17 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Module) -template <ACE_SYNCH_1> void -ACE_Module<ACE_SYNCH_2>::dump (void) const +template <ACE_SYNCH_DECL> void +ACE_Module<ACE_SYNCH_USE>::dump (void) const { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::dump"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::dump"); } -template <ACE_SYNCH_1> void -ACE_Module<ACE_SYNCH_2>::writer (ACE_Task<ACE_SYNCH_2> *q, +template <ACE_SYNCH_DECL> void +ACE_Module<ACE_SYNCH_USE>::writer (ACE_Task<ACE_SYNCH_USE> *q, int flags /* = M_DELETE_WRITER */) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::writer"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::writer"); // Close and maybe delete old writer this->close_i (1, flags); @@ -37,11 +37,11 @@ ACE_Module<ACE_SYNCH_2>::writer (ACE_Task<ACE_SYNCH_2> *q, ACE_SET_BITS (flags_, (flags & M_DELETE_WRITER)); } -template <ACE_SYNCH_1> void -ACE_Module<ACE_SYNCH_2>::reader (ACE_Task<ACE_SYNCH_2> *q, +template <ACE_SYNCH_DECL> void +ACE_Module<ACE_SYNCH_USE>::reader (ACE_Task<ACE_SYNCH_USE> *q, int flags /* = M_DELETE_READER */) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::reader"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::reader"); // Close and maybe delete old writer this->close_i (0, flags); @@ -56,23 +56,23 @@ ACE_Module<ACE_SYNCH_2>::reader (ACE_Task<ACE_SYNCH_2> *q, // Link this ACE_Module on top of ACE_Module M. -template <ACE_SYNCH_1> void -ACE_Module<ACE_SYNCH_2>::link (ACE_Module<ACE_SYNCH_2> *m) +template <ACE_SYNCH_DECL> void +ACE_Module<ACE_SYNCH_USE>::link (ACE_Module<ACE_SYNCH_USE> *m) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::link"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::link"); this->next (m); this->writer ()->next (m->writer ()); m->reader ()->next (this->reader ()); } -template <ACE_SYNCH_1> int -ACE_Module<ACE_SYNCH_2>::open (const char *mod_name, - ACE_Task<ACE_SYNCH_2> *writer_q, - ACE_Task<ACE_SYNCH_2> *reader_q, +template <ACE_SYNCH_DECL> int +ACE_Module<ACE_SYNCH_USE>::open (const char *mod_name, + ACE_Task<ACE_SYNCH_USE> *writer_q, + ACE_Task<ACE_SYNCH_USE> *reader_q, void *arg, int flags /* = M_DELETE */) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::open"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::open"); this->name (mod_name); this->arg_ = arg; @@ -85,13 +85,13 @@ ACE_Module<ACE_SYNCH_2>::open (const char *mod_name, if (writer_q == 0) { - writer_q = new ACE_Thru_Task<ACE_SYNCH_2>; + writer_q = new ACE_Thru_Task<ACE_SYNCH_USE>; ACE_SET_BITS (flags, M_DELETE_WRITER); } if (reader_q == 0) { - reader_q = new ACE_Thru_Task<ACE_SYNCH_2>; + reader_q = new ACE_Thru_Task<ACE_SYNCH_USE>; ACE_SET_BITS (flags, M_DELETE_READER); } @@ -123,10 +123,10 @@ ACE_Module<ACE_SYNCH_2>::open (const char *mod_name, // Set and get pointer to sibling ACE_Task in ACE_Module. -template <ACE_SYNCH_1> ACE_Task<ACE_SYNCH_2> * -ACE_Module<ACE_SYNCH_2>::sibling (ACE_Task<ACE_SYNCH_2> *orig) +template <ACE_SYNCH_DECL> ACE_Task<ACE_SYNCH_USE> * +ACE_Module<ACE_SYNCH_USE>::sibling (ACE_Task<ACE_SYNCH_USE> *orig) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::sibling"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::sibling"); if (this->q_pair_[0] == orig) return this->q_pair_[1]; else if (this->q_pair_[1] == orig) @@ -135,36 +135,36 @@ ACE_Module<ACE_SYNCH_2>::sibling (ACE_Task<ACE_SYNCH_2> *orig) return 0; } -template <ACE_SYNCH_1> -ACE_Module<ACE_SYNCH_2>::ACE_Module (void) +template <ACE_SYNCH_DECL> +ACE_Module<ACE_SYNCH_USE>::ACE_Module (void) : flags_ (0) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::ACE_Module"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::ACE_Module"); this->name ("<unknown>"); // Do nothing... this->q_pair_[0] = 0; this->q_pair_[1] = 0; } -template <ACE_SYNCH_1> -ACE_Module<ACE_SYNCH_2>::~ACE_Module (void) +template <ACE_SYNCH_DECL> +ACE_Module<ACE_SYNCH_USE>::~ACE_Module (void) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::~ACE_Module"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::~ACE_Module"); // Only close down if we haven't already done so. if (this->reader () || this->writer ()) this->close (); } -template <ACE_SYNCH_1> -ACE_Module<ACE_SYNCH_2>::ACE_Module (const char *mod_name, - ACE_Task<ACE_SYNCH_2> *writer_q, - ACE_Task<ACE_SYNCH_2> *reader_q, +template <ACE_SYNCH_DECL> +ACE_Module<ACE_SYNCH_USE>::ACE_Module (const char *mod_name, + ACE_Task<ACE_SYNCH_USE> *writer_q, + ACE_Task<ACE_SYNCH_USE> *reader_q, void *args, int flags /* = M_DELETE */) : flags_ (0) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::ACE_Module"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::ACE_Module"); this->q_pair_[0] = 0; this->q_pair_[1] = 0; @@ -173,10 +173,10 @@ ACE_Module<ACE_SYNCH_2>::ACE_Module (const char *mod_name, ACE_ERROR ((LM_ERROR, "%p\n", "ACE_Module")); } -template <ACE_SYNCH_1> int -ACE_Module<ACE_SYNCH_2>::close (int flags /* = M_DELETE_NONE */) +template <ACE_SYNCH_DECL> int +ACE_Module<ACE_SYNCH_USE>::close (int flags /* = M_DELETE_NONE */) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::close"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::close"); int result = 0; @@ -191,18 +191,18 @@ ACE_Module<ACE_SYNCH_2>::close (int flags /* = M_DELETE_NONE */) return result; } -template <ACE_SYNCH_1> int -ACE_Module<ACE_SYNCH_2>::close_i (int which, +template <ACE_SYNCH_DECL> int +ACE_Module<ACE_SYNCH_USE>::close_i (int which, int flags) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::close_i"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::close_i"); if (this->q_pair_[which] == 0) return 0; // Copy task pointer to prevent problems when ACE_Task::close // changes the task pointer - ACE_Task<ACE_SYNCH_2> *task = this->q_pair_[which]; + ACE_Task<ACE_SYNCH_USE> *task = this->q_pair_[which]; // Change so that close doesn't get called again from the task base. diff --git a/ace/Module.h b/ace/Module.h index 35d5b1f1b4f..7a1b34da082 100644 --- a/ace/Module.h +++ b/ace/Module.h @@ -21,9 +21,9 @@ #include "ace/Task_T.h" // Forward decl. -// template <ACE_SYNCH_1> class ACE_Task; +// template <ACE_SYNCH_DECL> class ACE_Task; -template <ACE_SYNCH_1> +template <ACE_SYNCH_DECL> class ACE_Module // = TITLE // An abstraction for managing a bi-directional flow of messages. @@ -61,16 +61,16 @@ public: // Shutdown the Module. ACE_Module (const char *module_name, - ACE_Task<ACE_SYNCH_2> *writer = 0, - ACE_Task<ACE_SYNCH_2> *reader = 0, + ACE_Task<ACE_SYNCH_USE> *writer = 0, + ACE_Task<ACE_SYNCH_USE> *reader = 0, void *args = 0, int flags = M_DELETE); // Create an initialized module with <module_name> as its identity // and <reader> and <writer> as its tasks. int open (const char *module_name, - ACE_Task<ACE_SYNCH_2> *writer = 0, - ACE_Task<ACE_SYNCH_2> *reader = 0, + ACE_Task<ACE_SYNCH_USE> *writer = 0, + ACE_Task<ACE_SYNCH_USE> *reader = 0, void *a = 0, int flags = M_DELETE); // Create an initialized module with <module_name> as its identity @@ -87,27 +87,27 @@ public: // Should not be called from within ACE_Task::module_closed(). // = ACE_Task manipulation routines - ACE_Task<ACE_SYNCH_2> *writer (void); + ACE_Task<ACE_SYNCH_USE> *writer (void); // Get the writer task. - void writer (ACE_Task<ACE_SYNCH_2> *q, int flags = M_DELETE_WRITER); + void writer (ACE_Task<ACE_SYNCH_USE> *q, int flags = M_DELETE_WRITER); // Set the writer task. <flags> can be used to indicate that the // module should delete the writer during a call to close or to the // destructor. If a previous writer exists, it is closed. It may // also be deleted, depending on the old flags_ value. Should not // be called from within ACE_Task::module_closed(). - ACE_Task<ACE_SYNCH_2> *reader (void); + ACE_Task<ACE_SYNCH_USE> *reader (void); // Get the reader task. - void reader (ACE_Task<ACE_SYNCH_2> *q, int flags = M_DELETE_READER); + void reader (ACE_Task<ACE_SYNCH_USE> *q, int flags = M_DELETE_READER); // Set the reader task. <flags> can be used to indicate that the // module should delete the reader during a call to close or to the // destructor. If a previous reader exists, it is closed. It may // also be deleted, depending on the old flags_ value. Should not // be called from within ACE_Task::module_closed() - ACE_Task<ACE_SYNCH_2> *sibling (ACE_Task<ACE_SYNCH_2> *orig); + ACE_Task<ACE_SYNCH_USE> *sibling (ACE_Task<ACE_SYNCH_USE> *orig); // Set and get pointer to sibling <ACE_Task> in an <ACE_Module> // = Identify the module @@ -123,13 +123,13 @@ public: void arg (void *); // Set the argument passed to the tasks. - void link (ACE_Module<ACE_SYNCH_2> *m); + void link (ACE_Module<ACE_SYNCH_USE> *m); // Link to other modules in the ustream stack - ACE_Module<ACE_SYNCH_2> *next (void); + ACE_Module<ACE_SYNCH_USE> *next (void); // Get the next pointer to the module above in the stream. - void next (ACE_Module<ACE_SYNCH_2> *m); + void next (ACE_Module<ACE_SYNCH_USE> *m); // Set the next pointer to the module above in the stream. void dump (void) const; @@ -143,14 +143,14 @@ private: // Implements the close operation for either the reader or the // writer task (depending on <which>). - ACE_Task<ACE_SYNCH_2> *q_pair_[2]; + ACE_Task<ACE_SYNCH_USE> *q_pair_[2]; // Pair of Tasks that form the "read-side" and "write-side" of the // ACE_Module partitioning. char name_[MAXNAMLEN + 1]; // Name of the ACE_Module. - ACE_Module<ACE_SYNCH_2> *next_; + ACE_Module<ACE_SYNCH_USE> *next_; // Next ACE_Module in the stack. void *arg_; diff --git a/ace/Module.i b/ace/Module.i index 8a2feaa7cde..af675d16870 100644 --- a/ace/Module.i +++ b/ace/Module.i @@ -3,59 +3,59 @@ // Module.i -template <ACE_SYNCH_1> ACE_INLINE void * -ACE_Module<ACE_SYNCH_2>::arg (void) const +template <ACE_SYNCH_DECL> ACE_INLINE void * +ACE_Module<ACE_SYNCH_USE>::arg (void) const { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::arg"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::arg"); return this->arg_; } -template <ACE_SYNCH_1> ACE_INLINE void -ACE_Module<ACE_SYNCH_2>::arg (void *a) +template <ACE_SYNCH_DECL> ACE_INLINE void +ACE_Module<ACE_SYNCH_USE>::arg (void *a) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::arg"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::arg"); this->arg_ = a; } -template <ACE_SYNCH_1> ACE_INLINE const char * -ACE_Module<ACE_SYNCH_2>::name (void) const +template <ACE_SYNCH_DECL> ACE_INLINE const char * +ACE_Module<ACE_SYNCH_USE>::name (void) const { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::name"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::name"); return this->name_; } -template <ACE_SYNCH_1> ACE_INLINE void -ACE_Module<ACE_SYNCH_2>::name (const char *n) +template <ACE_SYNCH_DECL> ACE_INLINE void +ACE_Module<ACE_SYNCH_USE>::name (const char *n) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::name"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::name"); ACE_OS::strncpy (this->name_, n, MAXNAMLEN); } -template <ACE_SYNCH_1> ACE_INLINE ACE_Task<ACE_SYNCH_2> * -ACE_Module<ACE_SYNCH_2>::writer (void) +template <ACE_SYNCH_DECL> ACE_INLINE ACE_Task<ACE_SYNCH_USE> * +ACE_Module<ACE_SYNCH_USE>::writer (void) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::writer"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::writer"); return this->q_pair_[1]; } -template <ACE_SYNCH_1> ACE_INLINE ACE_Task<ACE_SYNCH_2> * -ACE_Module<ACE_SYNCH_2>::reader (void) +template <ACE_SYNCH_DECL> ACE_INLINE ACE_Task<ACE_SYNCH_USE> * +ACE_Module<ACE_SYNCH_USE>::reader (void) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::reader"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::reader"); return this->q_pair_[0]; } -template <ACE_SYNCH_1> ACE_INLINE ACE_Module<ACE_SYNCH_2> * -ACE_Module<ACE_SYNCH_2>::next (void) +template <ACE_SYNCH_DECL> ACE_INLINE ACE_Module<ACE_SYNCH_USE> * +ACE_Module<ACE_SYNCH_USE>::next (void) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::next"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::next"); return this->next_; } -template <ACE_SYNCH_1> ACE_INLINE void -ACE_Module<ACE_SYNCH_2>::next (ACE_Module<ACE_SYNCH_2> *m) +template <ACE_SYNCH_DECL> ACE_INLINE void +ACE_Module<ACE_SYNCH_USE>::next (ACE_Module<ACE_SYNCH_USE> *m) { - ACE_TRACE ("ACE_Module<ACE_SYNCH_2>::next"); + ACE_TRACE ("ACE_Module<ACE_SYNCH_USE>::next"); this->next_ = m; } @@ -351,6 +351,7 @@ private: #endif /* ACE_WIN32 */ // Increase the range of "address families". +#define AF_ANY (-1) #define AF_SPIPE (AF_MAX + 1) #define AF_FILE (AF_MAX + 2) #define AF_DEV (AF_MAX + 3) @@ -806,8 +807,8 @@ private: #if defined (ACE_HAS_TEMPLATE_TYPEDEFS) // Handle ACE_Message_Queue. -#define ACE_SYNCH_1 class _ACE_SYNCH -#define ACE_SYNCH_2 _ACE_SYNCH +#define ACE_SYNCH_DECL class _ACE_SYNCH +#define ACE_SYNCH_USE _ACE_SYNCH #define ACE_SYNCH_MUTEX_T ACE_TYPENAME _ACE_SYNCH::MUTEX #define ACE_SYNCH_CONDITION_T ACE_TYPENAME _ACE_SYNCH::CONDITION #define ACE_SYNCH_SEMAPHORE_T ACE_TYPENAME _ACE_SYNCH::SEMAPHORE @@ -895,11 +896,11 @@ private: // Handle ACE_Message_Queue. #if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) -#define ACE_SYNCH_1 class _ACE_SYNCH_MUTEX_T, class _ACE_SYNCH_CONDITION_T, class _ACE_SYNCH_SEMAPHORE_T -#define ACE_SYNCH_2 _ACE_SYNCH_MUTEX_T, _ACE_SYNCH_CONDITION_T, _ACE_SYNCH_SEMAPHORE_T +#define ACE_SYNCH_DECL class _ACE_SYNCH_MUTEX_T, class _ACE_SYNCH_CONDITION_T, class _ACE_SYNCH_SEMAPHORE_T +#define ACE_SYNCH_USE _ACE_SYNCH_MUTEX_T, _ACE_SYNCH_CONDITION_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 +#define ACE_SYNCH_DECL class _ACE_SYNCH_MUTEX_T, class _ACE_SYNCH_CONDITION_T +#define ACE_SYNCH_USE _ACE_SYNCH_MUTEX_T, _ACE_SYNCH_CONDITION_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 @@ -1330,7 +1330,7 @@ ACE_OS::mutex_destroy (ACE_mutex_t *m) // ACE_TRACE ("ACE_OS::mutex_destroy"); #if defined (ACE_HAS_THREADS) #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) -# if defined (ACE_HAS_DCE_DRAFT4_THREADS) || defined (ACE_HAS_FSU_PTHREADS) +# if defined (ACE_HAS_DCE_DRAFT4_THREADS) ACE_OSCALL_RETURN (::pthread_mutex_destroy (m), int, -1); # else ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_mutex_destroy (m), ace_result_), int, -1); @@ -1367,7 +1367,7 @@ ACE_OS::mutex_lock (ACE_mutex_t *m) #if defined (ACE_HAS_THREADS) #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) // Note, don't use "::" here since the following call is often a macro. -# if defined (ACE_HAS_DCE_DRAFT4_THREADS) || defined (ACE_HAS_FSU_PTHREADS) +# if defined (ACE_HAS_DCE_DRAFT4_THREADS) ACE_OSCALL_RETURN (pthread_mutex_lock (m), int, -1); # else ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (pthread_mutex_lock (m), ace_result_), @@ -1462,8 +1462,6 @@ ACE_OS::mutex_trylock (ACE_mutex_t *m) errno = EBUSY; } return status; -# elif defined (ACE_HAS_FSU_PTHREADS) - ACE_OSCALL_RETURN (pthread_mutex_trylock (m), int, -1); # else ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (pthread_mutex_trylock (m), ace_result_), int, -1); @@ -1566,7 +1564,7 @@ ACE_OS::mutex_unlock (ACE_mutex_t *m) #if defined (ACE_HAS_THREADS) #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) // Note, don't use "::" here since the following call is often a macro. -# if defined (ACE_HAS_DCE_DRAFT4_THREADS) || defined (ACE_HAS_FSU_PTHREADS) +# if defined (ACE_HAS_DCE_DRAFT4_THREADS) ACE_OSCALL_RETURN (pthread_mutex_unlock (m), int, -1); # else ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (pthread_mutex_unlock (m), ace_result_), @@ -1721,7 +1719,7 @@ ACE_OS::cond_destroy (ACE_cond_t *cv) // ACE_TRACE ("ACE_OS::cond_destroy"); #if defined (ACE_HAS_THREADS) #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) -# if defined (ACE_HAS_DCE_DRAFT4_THREADS) || defined (ACE_HAS_FSU_PTHREADS) +# if defined (ACE_HAS_DCE_DRAFT4_THREADS) ACE_OSCALL_RETURN (::pthread_cond_destroy (cv), int, -1); # else ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_cond_destroy (cv), ace_result_), int, -1); @@ -1790,7 +1788,7 @@ ACE_OS::cond_signal (ACE_cond_t *cv) // ACE_TRACE ("ACE_OS::cond_signal"); #if defined (ACE_HAS_THREADS) #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) -# if defined (ACE_HAS_DCE_DRAFT4_THREADS) || defined (ACE_HAS_FSU_PTHREADS) +# if defined (ACE_HAS_DCE_DRAFT4_THREADS) ACE_OSCALL_RETURN (::pthread_cond_signal (cv), int, -1); # else ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_cond_signal (cv),ace_result_), @@ -1811,7 +1809,7 @@ ACE_OS::cond_broadcast (ACE_cond_t *cv) // ACE_TRACE ("ACE_OS::cond_broadcast"); #if defined (ACE_HAS_THREADS) #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) -# if defined (ACE_HAS_DCE_DRAFT4_THREADS) || defined (ACE_HAS_FSU_PTHREADS) +# if defined (ACE_HAS_DCE_DRAFT4_THREADS) ACE_OSCALL_RETURN (::pthread_cond_broadcast (cv), int, -1); # else ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_cond_broadcast (cv), @@ -1836,7 +1834,7 @@ ACE_OS::cond_wait (ACE_cond_t *cv, // ACE_TRACE ("ACE_OS::cond_wait"); #if defined (ACE_HAS_THREADS) #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) -# if defined (ACE_HAS_DCE_DRAFT4_THREADS) || defined (ACE_HAS_FSU_PTHREADS) +# if defined (ACE_HAS_DCE_DRAFT4_THREADS) ACE_OSCALL_RETURN (::pthread_cond_wait (cv, external_mutex), int, -1); # else ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_cond_wait (cv, external_mutex), ace_result_), @@ -1867,7 +1865,7 @@ ACE_OS::cond_timedwait (ACE_cond_t *cv, ts = *timeout; // Calls ACE_Time_Value::operator timespec_t(). #if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS) -# if defined (ACE_HAS_DCE_DRAFT4_THREADS) || defined (ACE_HAS_FSU_PTHREADS) +# if defined (ACE_HAS_DCE_DRAFT4_THREADS) ACE_OSCALL (timeout == 0 ? ::pthread_cond_wait (cv, external_mutex) : ::pthread_cond_timedwait (cv, external_mutex, @@ -4393,8 +4391,7 @@ ACE_OS::thr_getspecific (ACE_thread_key_t key, void **data) # elif !defined (ACE_HAS_FSU_PTHREADS) && defined (ACE_HAS_SETKIND_NP) || defined (ACE_HAS_PTHREAD_GETSPECIFIC_DATAPTR) ::pthread_getspecific (key, data); # else /* ACE_HAS_FSU_PTHREADS */ - // Is this really used anywhere? - *data = ::pthread_getspecific (key, data); + ::pthread_getspecific (key, data); # endif /* ACE_HAS_FSU_PTHREADS */ return 0; # elif defined (ACE_HAS_WTHREADS) diff --git a/ace/SPIPE_Addr.cpp b/ace/SPIPE_Addr.cpp index c68495de3b1..82b0e6829dc 100644 --- a/ace/SPIPE_Addr.cpp +++ b/ace/SPIPE_Addr.cpp @@ -32,7 +32,8 @@ ACE_SPIPE_Addr::set_addr (void *addr, int len) ACE_SPIPE_Addr::ACE_SPIPE_Addr (void) : ACE_Addr (AF_SPIPE, sizeof this->SPIPE_addr_) { - (void) ACE_OS::memset ((void *) &this->SPIPE_addr_, 0, + (void) ACE_OS::memset ((void *) &this->SPIPE_addr_, + 0, sizeof this->SPIPE_addr_); } @@ -52,15 +53,26 @@ ACE_SPIPE_Addr::string_to_addr (const char *addr) return this->set (ACE_WIDE_STRING (addr)); } -/* Copy constructor. */ +int +ACE_SPIPE_Addr::set (const ACE_SPIPE_Addr &sa) +{ + this->base_set (sa.get_type (), sa.get_size ()); + + if (sa.get_type () == AF_ANY) + (void) ACE_OS::memset ((void *) &this->SPIPE_addr_, + 0, + sizeof this->SPIPE_addr_); + else + (void) ACE_OS::memcpy ((void *) &this->SPIPE_addr_, (void *) + &sa.SPIPE_addr_, + sa.get_size ()); +} + +// Copy constructor. ACE_SPIPE_Addr::ACE_SPIPE_Addr (const ACE_SPIPE_Addr &sa) - : ACE_Addr (AF_SPIPE, - sizeof this->SPIPE_addr_.gid_ + sizeof this->SPIPE_addr_.uid_ - + ACE_OS::strlen (this->SPIPE_addr_.rendezvous_) + 1) { - (void) ACE_OS::memcpy ((void *) &this->SPIPE_addr_, (void *) - &sa.SPIPE_addr_, sa.get_size ()); + this->set (sa); } int @@ -69,7 +81,7 @@ ACE_SPIPE_Addr::set (LPCTSTR addr, uid_t uid) { int len = sizeof (this->SPIPE_addr_.uid_); - len += sizeof(this->SPIPE_addr_.gid_); + len += sizeof (this->SPIPE_addr_.gid_); #if defined (ACE_WIN32) TCHAR *colonp = ACE_OS::strchr (addr, ':'); @@ -97,11 +109,12 @@ ACE_SPIPE_Addr::set (LPCTSTR addr, ACE_OS::strcpy(this->SPIPE_addr_.rendezvous_, temp) ; #else - this->ACE_Addr::base_set (AF_SPIPE, ACE_OS::strlen (addr) + len); - ACE_OS::strncpy (this->SPIPE_addr_.rendezvous_, addr, + this->ACE_Addr::base_set (AF_SPIPE, + ACE_OS::strlen (addr) + len); + ACE_OS::strncpy (this->SPIPE_addr_.rendezvous_, + addr, sizeof this->SPIPE_addr_.rendezvous_); #endif - this->SPIPE_addr_.gid_ = gid == 0 ? ACE_OS::getgid () : gid; this->SPIPE_addr_.uid_ = uid == 0 ? ACE_OS::getuid () : uid; return 0; diff --git a/ace/SPIPE_Addr.h b/ace/SPIPE_Addr.h index 0696775b3c4..85d7b5289bd 100644 --- a/ace/SPIPE_Addr.h +++ b/ace/SPIPE_Addr.h @@ -35,6 +35,9 @@ public: ACE_SPIPE_Addr (LPCTSTR rendezvous_point, gid_t = 0, uid_t = 0); // Create a ACE_SPIPE_Addr from a rendezvous point in the file system. + int set (const ACE_SPIPE_Addr &sa); + // Acts like a copy constructor... + int set (LPCTSTR rendezvous_point, gid_t = 0, uid_t = 0); // Create a ACE_SPIPE_Addr from a rendezvous point in the file system. diff --git a/ace/Stream.cpp b/ace/Stream.cpp index 87ae733e4c3..816a08b20a0 100644 --- a/ace/Stream.cpp +++ b/ace/Stream.cpp @@ -17,13 +17,13 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Stream) // Give some idea of what the heck is going on in a stream! -template <ACE_SYNCH_1> void -ACE_Stream<ACE_SYNCH_2>::dump (void) const +template <ACE_SYNCH_DECL> void +ACE_Stream<ACE_SYNCH_USE>::dump (void) const { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::dump"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::dump"); ACE_DEBUG ((LM_DEBUG, "-------- module links --------\n")); - for (ACE_Module<ACE_SYNCH_2> *mp = this->stream_head_; + for (ACE_Module<ACE_SYNCH_USE> *mp = this->stream_head_; ; mp = mp->next ()) { @@ -34,7 +34,7 @@ ACE_Stream<ACE_SYNCH_2>::dump (void) const ACE_DEBUG ((LM_DEBUG, "-------- writer links --------\n")); - ACE_Task<ACE_SYNCH_2> *tp; + ACE_Task<ACE_SYNCH_USE> *tp; for (tp = this->stream_head_->writer (); ; @@ -62,10 +62,10 @@ ACE_Stream<ACE_SYNCH_2>::dump (void) const } } -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::push (ACE_Module<ACE_SYNCH_2> *new_top) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::push (ACE_Module<ACE_SYNCH_USE> *new_top) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::push"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::push"); if (this->push_module (new_top, this->stream_head_->next (), this->stream_head_) == -1) @@ -74,27 +74,27 @@ ACE_Stream<ACE_SYNCH_2>::push (ACE_Module<ACE_SYNCH_2> *new_top) return 0; } -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::put (ACE_Message_Block *mb, ACE_Time_Value *tv) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::put (ACE_Message_Block *mb, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::put"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::put"); return this->stream_head_->writer ()->put (mb, tv); } -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::get (ACE_Message_Block *&mb, ACE_Time_Value *tv) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::get (ACE_Message_Block *&mb, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::get"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::get"); return this->stream_head_->reader ()->getq (mb, tv); } // Return the "top" ACE_Module in a ACE_Stream, skipping over the // stream_head. -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::top (ACE_Module<ACE_SYNCH_2> *&m) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::top (ACE_Module<ACE_SYNCH_USE> *&m) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::top"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::top"); if (this->stream_head_->next () == this->stream_tail_) return -1; else @@ -107,17 +107,17 @@ ACE_Stream<ACE_SYNCH_2>::top (ACE_Module<ACE_SYNCH_2> *&m) // Remove the "top" ACE_Module in a ACE_Stream, skipping over the // stream_head. -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::pop (int flags) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::pop (int flags) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::pop"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::pop"); if (this->stream_head_->next () == this->stream_tail_) return -1; else { // Skip over the ACE_Stream head. - ACE_Module<ACE_SYNCH_2> *top_mod = this->stream_head_->next (); - ACE_Module<ACE_SYNCH_2> *new_top = top_mod->next (); + ACE_Module<ACE_SYNCH_USE> *top_mod = this->stream_head_->next (); + ACE_Module<ACE_SYNCH_USE> *new_top = top_mod->next (); this->stream_head_->next (new_top); @@ -126,7 +126,7 @@ ACE_Stream<ACE_SYNCH_2>::pop (int flags) top_mod->close (flags); // Don't delete the Module unless the flags request this. - if (flags != ACE_Module<ACE_SYNCH_2>::M_DELETE_NONE) + if (flags != ACE_Module<ACE_SYNCH_USE>::M_DELETE_NONE) delete top_mod; this->stream_head_->writer ()->next (new_top->writer ()); @@ -138,14 +138,14 @@ ACE_Stream<ACE_SYNCH_2>::pop (int flags) // Remove a named ACE_Module from an arbitrary place in the // ACE_Stream. -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::remove (const char *name, +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::remove (const char *name, int flags) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::remove"); - ACE_Module<ACE_SYNCH_2> *prev = 0; + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::remove"); + ACE_Module<ACE_SYNCH_USE> *prev = 0; - for (ACE_Module<ACE_SYNCH_2> *mod = this->stream_head_; + for (ACE_Module<ACE_SYNCH_USE> *mod = this->stream_head_; mod != 0; mod = mod->next ()) if (ACE_OS::strcmp (mod->name (), name) == 0) @@ -156,7 +156,7 @@ ACE_Stream<ACE_SYNCH_2>::remove (const char *name, prev->link (mod->next ()); // Don't delete the Module unless the flags request this. - if (flags != ACE_Module<ACE_SYNCH_2>::M_DELETE_NONE) + if (flags != ACE_Module<ACE_SYNCH_USE>::M_DELETE_NONE) { // Close down the module and release the memory. mod->close (flags); @@ -171,11 +171,11 @@ ACE_Stream<ACE_SYNCH_2>::remove (const char *name, return -1; } -template <ACE_SYNCH_1> ACE_Module<ACE_SYNCH_2> * -ACE_Stream<ACE_SYNCH_2>::find (const char *name) +template <ACE_SYNCH_DECL> ACE_Module<ACE_SYNCH_USE> * +ACE_Stream<ACE_SYNCH_USE>::find (const char *name) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::find"); - for (ACE_Module<ACE_SYNCH_2> *mod = this->stream_head_; + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::find"); + for (ACE_Module<ACE_SYNCH_USE> *mod = this->stream_head_; mod != 0; mod = mod->next ()) if (ACE_OS::strcmp (mod->name (), name) == 0) @@ -186,16 +186,16 @@ ACE_Stream<ACE_SYNCH_2>::find (const char *name) // Actually push a module onto the stack... -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::push_module (ACE_Module<ACE_SYNCH_2> *new_top, - ACE_Module<ACE_SYNCH_2> *current_top, - ACE_Module<ACE_SYNCH_2> *head) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::push_module (ACE_Module<ACE_SYNCH_USE> *new_top, + ACE_Module<ACE_SYNCH_USE> *current_top, + ACE_Module<ACE_SYNCH_USE> *head) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::push_module"); - ACE_Task<ACE_SYNCH_2> *nt_reader = new_top->reader (); - ACE_Task<ACE_SYNCH_2> *nt_writer = new_top->writer (); - ACE_Task<ACE_SYNCH_2> *ct_reader = 0; - ACE_Task<ACE_SYNCH_2> *ct_writer = 0; + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::push_module"); + ACE_Task<ACE_SYNCH_USE> *nt_reader = new_top->reader (); + ACE_Task<ACE_SYNCH_USE> *nt_writer = new_top->writer (); + ACE_Task<ACE_SYNCH_USE> *ct_reader = 0; + ACE_Task<ACE_SYNCH_USE> *ct_writer = 0; if (current_top) { @@ -225,37 +225,37 @@ ACE_Stream<ACE_SYNCH_2>::push_module (ACE_Module<ACE_SYNCH_2> *new_top, } #if 0 -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::open (void *a, +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::open (void *a, ACE_Multiplexor &muxer, - ACE_Module<ACE_SYNCH_2> *head) + ACE_Module<ACE_SYNCH_USE> *head) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::open"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::open"); this->stream_head_ = head == 0 - ? new ACE_Module<ACE_SYNCH_2> ("ACE_Stream_Head", - new ACE_Stream_Head<ACE_SYNCH_2>, - new ACE_Stream_Head<ACE_SYNCH_2>, a) : head; + ? new ACE_Module<ACE_SYNCH_USE> ("ACE_Stream_Head", + new ACE_Stream_Head<ACE_SYNCH_USE>, + new ACE_Stream_Head<ACE_SYNCH_USE>, a) : head; this->stream_tail_ = 0; return muxer.link_from_below (this->stream_head_); } #endif -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::open (void *a, - ACE_Module<ACE_SYNCH_2> *head, - ACE_Module<ACE_SYNCH_2> *tail) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::open (void *a, + ACE_Module<ACE_SYNCH_USE> *head, + ACE_Module<ACE_SYNCH_USE> *tail) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::open"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::open"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); - ACE_Task<ACE_SYNCH_2> *h1 = 0, *h2 = 0; - ACE_Task<ACE_SYNCH_2> *t1 = 0, *t2 = 0; + ACE_Task<ACE_SYNCH_USE> *h1 = 0, *h2 = 0; + ACE_Task<ACE_SYNCH_USE> *t1 = 0, *t2 = 0; if (head == 0) { - h1 = new ACE_Stream_Head<ACE_SYNCH_2>; - h2 = new ACE_Stream_Head<ACE_SYNCH_2>; - head = new ACE_Module<ACE_SYNCH_2> ("ACE_Stream_Head", + h1 = new ACE_Stream_Head<ACE_SYNCH_USE>; + h2 = new ACE_Stream_Head<ACE_SYNCH_USE>; + head = new ACE_Module<ACE_SYNCH_USE> ("ACE_Stream_Head", h1, h2, a, M_DELETE); @@ -263,9 +263,9 @@ ACE_Stream<ACE_SYNCH_2>::open (void *a, if (tail == 0) { - t1 = new ACE_Stream_Tail<ACE_SYNCH_2>; - t2 = new ACE_Stream_Tail<ACE_SYNCH_2>; - tail = new ACE_Module<ACE_SYNCH_2> ("ACE_Stream_Tail", + t1 = new ACE_Stream_Tail<ACE_SYNCH_USE>; + t2 = new ACE_Stream_Tail<ACE_SYNCH_USE>; + tail = new ACE_Module<ACE_SYNCH_USE> ("ACE_Stream_Tail", t1, t2, a, M_DELETE); @@ -298,10 +298,10 @@ ACE_Stream<ACE_SYNCH_2>::open (void *a, return 0; } -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::close (int flags) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::close (int flags) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::close"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::close"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); if (this->stream_head_ != 0 @@ -338,11 +338,11 @@ ACE_Stream<ACE_SYNCH_2>::close (int flags) return 0; } -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, void *a) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::control"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::control"); ACE_IO_Cntl_Msg ioc (cmd); ACE_Message_Block *db = 0; @@ -391,15 +391,15 @@ ACE_Stream<ACE_SYNCH_2>::control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, // on the fact that the Stream head and Stream tail are non-NULL... // This must be called with locks held. -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::link_i (ACE_Stream<ACE_SYNCH_2> &us) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::link_i (ACE_Stream<ACE_SYNCH_USE> &us) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::link_i"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::link_i"); this->linked_us_ = &us; // Make sure the other side is also linked to us! us.linked_us_ = this; - ACE_Module<ACE_SYNCH_2> *my_tail = this->stream_head_; + ACE_Module<ACE_SYNCH_USE> *my_tail = this->stream_head_; if (my_tail == 0) return -1; @@ -408,7 +408,7 @@ ACE_Stream<ACE_SYNCH_2>::link_i (ACE_Stream<ACE_SYNCH_2> &us) while (my_tail->next () != this->stream_tail_) my_tail = my_tail->next (); - ACE_Module<ACE_SYNCH_2> *other_tail = us.stream_head_; + ACE_Module<ACE_SYNCH_USE> *other_tail = us.stream_head_; if (other_tail == 0) return -1; @@ -423,10 +423,10 @@ ACE_Stream<ACE_SYNCH_2>::link_i (ACE_Stream<ACE_SYNCH_2> &us) return 0; } -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::link (ACE_Stream<ACE_SYNCH_2> &us) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::link (ACE_Stream<ACE_SYNCH_USE> &us) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::link"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::link"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); @@ -435,16 +435,16 @@ ACE_Stream<ACE_SYNCH_2>::link (ACE_Stream<ACE_SYNCH_2> &us) // Must be called with locks held... -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::unlink_i (void) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::unlink_i (void) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::unlink_i"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::unlink_i"); // Only try to unlink if we are in fact still linked! if (this->linked_us_ != 0) { - ACE_Module<ACE_SYNCH_2> *my_tail = this->stream_head_; + ACE_Module<ACE_SYNCH_USE> *my_tail = this->stream_head_; // Only relink if we still exist! if (my_tail) @@ -457,7 +457,7 @@ ACE_Stream<ACE_SYNCH_2>::unlink_i (void) my_tail->writer ()->next (this->stream_tail_->writer ()); } - ACE_Module<ACE_SYNCH_2> *other_tail = + ACE_Module<ACE_SYNCH_USE> *other_tail = this->linked_us_->stream_head_; // Only fiddle with the other side if it in fact still remains. @@ -480,55 +480,55 @@ ACE_Stream<ACE_SYNCH_2>::unlink_i (void) return -1; } -template <ACE_SYNCH_1> int -ACE_Stream<ACE_SYNCH_2>::unlink (void) +template <ACE_SYNCH_DECL> int +ACE_Stream<ACE_SYNCH_USE>::unlink (void) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::unlink"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::unlink"); ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_, -1); return this->unlink_i (); } -template <ACE_SYNCH_1> -ACE_Stream<ACE_SYNCH_2>::ACE_Stream (void * a, - ACE_Module<ACE_SYNCH_2> *head, - ACE_Module<ACE_SYNCH_2> *tail) +template <ACE_SYNCH_DECL> +ACE_Stream<ACE_SYNCH_USE>::ACE_Stream (void * a, + ACE_Module<ACE_SYNCH_USE> *head, + ACE_Module<ACE_SYNCH_USE> *tail) : linked_us_ (0), final_close_ (this->lock_) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::ACE_Stream"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::ACE_Stream"); if (this->open (a, head, tail) == -1) - ACE_ERROR ((LM_ERROR, "ACE_Stream<ACE_SYNCH_2>::open (%s, %s)\n", + ACE_ERROR ((LM_ERROR, "ACE_Stream<ACE_SYNCH_USE>::open (%s, %s)\n", head->name (), tail->name ())); } #if 0 -ACE_Stream<ACE_SYNCH_2>::ACE_Stream (void *a, +ACE_Stream<ACE_SYNCH_USE>::ACE_Stream (void *a, ACE_Multiplexor &muxer, - ACE_Module<ACE_SYNCH_2> *head) + ACE_Module<ACE_SYNCH_USE> *head) : linked_us_ (0), final_close_ (this->lock_) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::ACE_Stream"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::ACE_Stream"); if (this->open (a, muxer, head) == -1) - ACE_ERROR ((LM_ERROR, "ACE_Stream<ACE_SYNCH_2>::open (%s, %s)\n", + ACE_ERROR ((LM_ERROR, "ACE_Stream<ACE_SYNCH_USE>::open (%s, %s)\n", head->name ())); } #endif -template <ACE_SYNCH_1> -ACE_Stream<ACE_SYNCH_2>::~ACE_Stream (void) +template <ACE_SYNCH_DECL> +ACE_Stream<ACE_SYNCH_USE>::~ACE_Stream (void) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::~ACE_Stream"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::~ACE_Stream"); if (this->stream_head_ != 0) this->close (); } -template <ACE_SYNCH_1> -ACE_Stream_Iterator<ACE_SYNCH_2>::ACE_Stream_Iterator (const ACE_Stream<ACE_SYNCH_2> &sr) +template <ACE_SYNCH_DECL> +ACE_Stream_Iterator<ACE_SYNCH_USE>::ACE_Stream_Iterator (const ACE_Stream<ACE_SYNCH_USE> &sr) : next_ (sr.stream_head_) { - ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_2>::ACE_Stream_Iterator"); + ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE>::ACE_Stream_Iterator"); } #endif /* ACE_STREAM_C */ diff --git a/ace/Stream.h b/ace/Stream.h index d0a9a2addeb..a3803293072 100644 --- a/ace/Stream.h +++ b/ace/Stream.h @@ -26,10 +26,10 @@ #include "ace/Module.h" // Forward decls. -template<ACE_SYNCH_1> class ACE_Stream_Iterator; -//template<ACE_SYNCH_1> class ACE_Module; +template<ACE_SYNCH_DECL> class ACE_Stream_Iterator; +//template<ACE_SYNCH_DECL> class ACE_Module; -template <ACE_SYNCH_1> +template <ACE_SYNCH_DECL> class ACE_Stream // = TITLE // This class is the primary abstraction for the ASX framework. @@ -39,7 +39,7 @@ class ACE_Stream // A Stream consists of a stack of <ACE_Modules>, each of which // contains two <ACE_Tasks>. { -friend class ACE_Stream_Iterator<ACE_SYNCH_2>; +friend class ACE_Stream_Iterator<ACE_SYNCH_USE>; public: enum { @@ -50,16 +50,16 @@ public: // = Initializatation and termination methods. ACE_Stream (void *arg = 0, - ACE_Module<ACE_SYNCH_2> *head = 0, - ACE_Module<ACE_SYNCH_2> *tail = 0); + ACE_Module<ACE_SYNCH_USE> *head = 0, + ACE_Module<ACE_SYNCH_USE> *tail = 0); // Create a Stream consisting of <head> and <tail> as the Stream // head and Stream tail, respectively. If these are 0 then the // <ACE_Stream_Head> and <ACE_Stream_Tail> are used, respectively. // <arg> is the value past in to the open() methods of the tasks. int open (void *arg, - ACE_Module<ACE_SYNCH_2> *head = 0, - ACE_Module<ACE_SYNCH_2> *tail = 0); + ACE_Module<ACE_SYNCH_USE> *head = 0, + ACE_Module<ACE_SYNCH_USE> *tail = 0); // Create a Stream consisting of <head> and <tail> as the Stream // head and Stream tail, respectively. If these are 0 then the // <ACE_Stream_Head> and <ACE_Stream_Tail> are used, respectively. @@ -73,13 +73,13 @@ public: // = ACE_Stream plumbing operations - int push (ACE_Module<ACE_SYNCH_2> *mod); + int push (ACE_Module<ACE_SYNCH_USE> *mod); // Add a new module <mod> right below the Stream head. int pop (int flags = M_DELETE); // Remove the <mod> right below the Stream head and close it down. - int top (ACE_Module<ACE_SYNCH_2> *&mod); + int top (ACE_Module<ACE_SYNCH_USE> *&mod); // Return the top module on the stream (right below the stream // head). @@ -87,16 +87,16 @@ public: // Remove the named module <mod> from the stream. This bypasses the // strict LIFO ordering of push() and pop(). - ACE_Module<ACE_SYNCH_2> *head (void); + ACE_Module<ACE_SYNCH_USE> *head (void); // Return current stream head. - ACE_Module<ACE_SYNCH_2> *tail (void); + ACE_Module<ACE_SYNCH_USE> *tail (void); // Return current stream tail. - ACE_Module<ACE_SYNCH_2> *find (const char *mod); + ACE_Module<ACE_SYNCH_USE> *find (const char *mod); // Find a particular ACE_Module. - int link (ACE_Stream<ACE_SYNCH_2> &); + int link (ACE_Stream<ACE_SYNCH_USE> &); // Create a pipe between two Streams. int unlink (void); @@ -132,22 +132,22 @@ private: // Actually perform the unlinking of two Streams (must be called // with locks held). - int link_i (ACE_Stream<ACE_SYNCH_2> &); + int link_i (ACE_Stream<ACE_SYNCH_USE> &); // Actually perform the linking of two Streams (must be called with // locks held). - int push_module (ACE_Module<ACE_SYNCH_2> *, - ACE_Module<ACE_SYNCH_2> * = 0, - ACE_Module<ACE_SYNCH_2> * = 0); + int push_module (ACE_Module<ACE_SYNCH_USE> *, + ACE_Module<ACE_SYNCH_USE> * = 0, + ACE_Module<ACE_SYNCH_USE> * = 0); // Must a new module onto the Stream. - ACE_Module<ACE_SYNCH_2> *stream_head_; + ACE_Module<ACE_SYNCH_USE> *stream_head_; // Pointer to the head of the stream. - ACE_Module<ACE_SYNCH_2> *stream_tail_; + ACE_Module<ACE_SYNCH_USE> *stream_tail_; // Pointer to the tail of the stream. - ACE_Stream<ACE_SYNCH_2> *linked_us_; + ACE_Stream<ACE_SYNCH_USE> *linked_us_; // Pointer to an adjoining linked stream. // = Synchronization objects used for thread-safe streams. @@ -158,18 +158,18 @@ private: // Use to tell all threads waiting on the close that we are done. }; -template <ACE_SYNCH_1> +template <ACE_SYNCH_DECL> class ACE_Stream_Iterator // = TITLE // Iterate through an <ACE_Stream>. { public: // = Initialization method. - ACE_Stream_Iterator (const ACE_Stream<ACE_SYNCH_2> &sr); + ACE_Stream_Iterator (const ACE_Stream<ACE_SYNCH_USE> &sr); // = Iteration methods. - int next (const ACE_Module<ACE_SYNCH_2> *&next_item); + int next (const ACE_Module<ACE_SYNCH_USE> *&next_item); // Pass back the <next_item> that hasn't been seen in the set. // Returns 0 when all items have been seen, else 1. @@ -181,7 +181,7 @@ public: // items in the set have been seen, else 1. private: - ACE_Module<ACE_SYNCH_2> *next_; + ACE_Module<ACE_SYNCH_USE> *next_; // Next <Module> that we haven't yet seen. }; diff --git a/ace/Stream.i b/ace/Stream.i index 9406b02fb26..42a4989eff0 100644 --- a/ace/Stream.i +++ b/ace/Stream.i @@ -3,46 +3,46 @@ // Stream.i -template <ACE_SYNCH_1> ACE_INLINE ACE_Module<ACE_SYNCH_2> * -ACE_Stream<ACE_SYNCH_2>::head (void) +template <ACE_SYNCH_DECL> ACE_INLINE ACE_Module<ACE_SYNCH_USE> * +ACE_Stream<ACE_SYNCH_USE>::head (void) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::head"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::head"); return this->stream_head_; } -template <ACE_SYNCH_1> ACE_INLINE ACE_Module<ACE_SYNCH_2> * -ACE_Stream<ACE_SYNCH_2>::tail (void) +template <ACE_SYNCH_DECL> ACE_INLINE ACE_Module<ACE_SYNCH_USE> * +ACE_Stream<ACE_SYNCH_USE>::tail (void) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::tail"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::tail"); return this->stream_tail_; } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Stream<ACE_SYNCH_2>::wait (void) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Stream<ACE_SYNCH_USE>::wait (void) { - ACE_TRACE ("ACE_Stream<ACE_SYNCH_2>::wait"); + ACE_TRACE ("ACE_Stream<ACE_SYNCH_USE>::wait"); return this->final_close_.wait (); } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Stream_Iterator<ACE_SYNCH_2>::next (const ACE_Module<ACE_SYNCH_2> *&mod) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Stream_Iterator<ACE_SYNCH_USE>::next (const ACE_Module<ACE_SYNCH_USE> *&mod) { - ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_2>::next"); + ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE>::next"); mod = this->next_; return this->next_ != 0; } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Stream_Iterator<ACE_SYNCH_2>::done (void) const +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Stream_Iterator<ACE_SYNCH_USE>::done (void) const { - ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_2>::done"); + ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE>::done"); return this->next_ == 0; } -template <ACE_SYNCH_1> int -ACE_Stream_Iterator<ACE_SYNCH_2>::advance (void) +template <ACE_SYNCH_DECL> int +ACE_Stream_Iterator<ACE_SYNCH_USE>::advance (void) { - ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_2>::advance"); + ACE_TRACE ("ACE_Stream_Iterator<ACE_SYNCH_USE>::advance"); this->next_ = this->next_->next (); return this->next_ != 0; } diff --git a/ace/Stream_Modules.cpp b/ace/Stream_Modules.cpp index 1d9dfee20c4..073293ebb06 100644 --- a/ace/Stream_Modules.cpp +++ b/ace/Stream_Modules.cpp @@ -13,51 +13,51 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Stream_Head) -template <ACE_SYNCH_1> -ACE_Stream_Head<ACE_SYNCH_2>::ACE_Stream_Head (void) +template <ACE_SYNCH_DECL> +ACE_Stream_Head<ACE_SYNCH_USE>::ACE_Stream_Head (void) { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::ACE_Stream_Head"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::ACE_Stream_Head"); } -template <ACE_SYNCH_1> -ACE_Stream_Head<ACE_SYNCH_2>::~ACE_Stream_Head (void) +template <ACE_SYNCH_DECL> +ACE_Stream_Head<ACE_SYNCH_USE>::~ACE_Stream_Head (void) { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::~ACE_Stream_Head"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::~ACE_Stream_Head"); } -template <ACE_SYNCH_1> void -ACE_Stream_Head<ACE_SYNCH_2>::dump (void) const +template <ACE_SYNCH_DECL> void +ACE_Stream_Head<ACE_SYNCH_USE>::dump (void) const { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::dump"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::dump"); } // ACE_Module that act as the head and tail of a Stream. -template <ACE_SYNCH_1> int -ACE_Stream_Head<ACE_SYNCH_2>::open (void *) +template <ACE_SYNCH_DECL> int +ACE_Stream_Head<ACE_SYNCH_USE>::open (void *) { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::open"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::open"); return 0; } -template <ACE_SYNCH_1> int -ACE_Stream_Head<ACE_SYNCH_2>::close (u_long) +template <ACE_SYNCH_DECL> int +ACE_Stream_Head<ACE_SYNCH_USE>::close (u_long) { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::close"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::close"); return 0; } -template <ACE_SYNCH_1> int -ACE_Stream_Head<ACE_SYNCH_2>::svc (void) +template <ACE_SYNCH_DECL> int +ACE_Stream_Head<ACE_SYNCH_USE>::svc (void) { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::svc"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::svc"); return -1; } -template <ACE_SYNCH_1> int -ACE_Stream_Head<ACE_SYNCH_2>::control (ACE_Message_Block *mb) +template <ACE_SYNCH_DECL> int +ACE_Stream_Head<ACE_SYNCH_USE>::control (ACE_Message_Block *mb) { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::control"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::control"); ACE_IO_Cntl_Msg *ioc = (ACE_IO_Cntl_Msg *) mb->rd_ptr (); ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd; @@ -76,10 +76,10 @@ ACE_Stream_Head<ACE_SYNCH_2>::control (ACE_Message_Block *mb) // Performs canonical flushing at the ACE_Stream Head. -template <ACE_SYNCH_1> int -ACE_Stream_Head<ACE_SYNCH_2>::canonical_flush (ACE_Message_Block *mb) +template <ACE_SYNCH_DECL> int +ACE_Stream_Head<ACE_SYNCH_USE>::canonical_flush (ACE_Message_Block *mb) { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::canonical_flush"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::canonical_flush"); char *cp = mb->rd_ptr (); if (ACE_BIT_ENABLED (*cp, ACE_Task_Flags::ACE_FLUSHR)) @@ -95,11 +95,11 @@ ACE_Stream_Head<ACE_SYNCH_2>::canonical_flush (ACE_Message_Block *mb) return 0; } -template <ACE_SYNCH_1> int -ACE_Stream_Head<ACE_SYNCH_2>::put (ACE_Message_Block *mb, +template <ACE_SYNCH_DECL> int +ACE_Stream_Head<ACE_SYNCH_USE>::put (ACE_Message_Block *mb, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::put"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::put"); int res = 0; if (mb->msg_type () == ACE_Message_Block::MB_IOCTL @@ -122,17 +122,17 @@ ACE_Stream_Head<ACE_SYNCH_2>::put (ACE_Message_Block *mb, } } -template <ACE_SYNCH_1> int -ACE_Stream_Head<ACE_SYNCH_2>::init (int, char *[]) +template <ACE_SYNCH_DECL> int +ACE_Stream_Head<ACE_SYNCH_USE>::init (int, char *[]) { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::init"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::init"); return 0; } -template <ACE_SYNCH_1> int -ACE_Stream_Head<ACE_SYNCH_2>::info (char **strp, size_t length) const +template <ACE_SYNCH_DECL> int +ACE_Stream_Head<ACE_SYNCH_USE>::info (char **strp, size_t length) const { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::info"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::info"); const char *name = this->name (); if (*strp == 0 && (*strp = ACE_OS::strdup (name)) == 0) @@ -142,58 +142,58 @@ ACE_Stream_Head<ACE_SYNCH_2>::info (char **strp, size_t length) const return ACE_OS::strlen (name); } -template <ACE_SYNCH_1> int -ACE_Stream_Head<ACE_SYNCH_2>::fini (void) +template <ACE_SYNCH_DECL> int +ACE_Stream_Head<ACE_SYNCH_USE>::fini (void) { - ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_2>::fini"); + ACE_TRACE ("ACE_Stream_Head<ACE_SYNCH_USE>::fini"); return 0; } ACE_ALLOC_HOOK_DEFINE(ACE_Stream_Tail) -template <ACE_SYNCH_1> -ACE_Stream_Tail<ACE_SYNCH_2>::ACE_Stream_Tail (void) +template <ACE_SYNCH_DECL> +ACE_Stream_Tail<ACE_SYNCH_USE>::ACE_Stream_Tail (void) { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::ACE_Stream_Tail"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::ACE_Stream_Tail"); } -template <ACE_SYNCH_1> -ACE_Stream_Tail<ACE_SYNCH_2>::~ACE_Stream_Tail (void) +template <ACE_SYNCH_DECL> +ACE_Stream_Tail<ACE_SYNCH_USE>::~ACE_Stream_Tail (void) { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::~ACE_Stream_Tail"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::~ACE_Stream_Tail"); } -template <ACE_SYNCH_1> void -ACE_Stream_Tail<ACE_SYNCH_2>::dump (void) const +template <ACE_SYNCH_DECL> void +ACE_Stream_Tail<ACE_SYNCH_USE>::dump (void) const { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::dump"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::dump"); } -template <ACE_SYNCH_1> int -ACE_Stream_Tail<ACE_SYNCH_2>::open (void *) +template <ACE_SYNCH_DECL> int +ACE_Stream_Tail<ACE_SYNCH_USE>::open (void *) { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::open"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::open"); return 0; } -template <ACE_SYNCH_1> int -ACE_Stream_Tail<ACE_SYNCH_2>::close (u_long) +template <ACE_SYNCH_DECL> int +ACE_Stream_Tail<ACE_SYNCH_USE>::close (u_long) { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::close"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::close"); return 0; } -template <ACE_SYNCH_1> int -ACE_Stream_Tail<ACE_SYNCH_2>::svc (void) +template <ACE_SYNCH_DECL> int +ACE_Stream_Tail<ACE_SYNCH_USE>::svc (void) { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::svc"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::svc"); return -1; } -template <ACE_SYNCH_1> int -ACE_Stream_Tail<ACE_SYNCH_2>::control (ACE_Message_Block *mb) +template <ACE_SYNCH_DECL> int +ACE_Stream_Tail<ACE_SYNCH_USE>::control (ACE_Message_Block *mb) { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::control"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::control"); ACE_IO_Cntl_Msg *ioc = (ACE_IO_Cntl_Msg *) mb->rd_ptr (); ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd; @@ -217,10 +217,10 @@ ACE_Stream_Tail<ACE_SYNCH_2>::control (ACE_Message_Block *mb) // Perform flush algorithm as though we were the driver. -template <ACE_SYNCH_1> int -ACE_Stream_Tail<ACE_SYNCH_2>::canonical_flush (ACE_Message_Block *mb) +template <ACE_SYNCH_DECL> int +ACE_Stream_Tail<ACE_SYNCH_USE>::canonical_flush (ACE_Message_Block *mb) { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::canonical_flush"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::canonical_flush"); char *cp = mb->rd_ptr (); if (ACE_BIT_ENABLED (*cp, ACE_Task_Flags::ACE_FLUSHW)) @@ -240,11 +240,11 @@ ACE_Stream_Tail<ACE_SYNCH_2>::canonical_flush (ACE_Message_Block *mb) return 0; } -template <ACE_SYNCH_1> int -ACE_Stream_Tail<ACE_SYNCH_2>::put (ACE_Message_Block *mb, +template <ACE_SYNCH_DECL> int +ACE_Stream_Tail<ACE_SYNCH_USE>::put (ACE_Message_Block *mb, ACE_Time_Value *) { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::put"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::put"); if (this->is_writer ()) { @@ -261,17 +261,17 @@ ACE_Stream_Tail<ACE_SYNCH_2>::put (ACE_Message_Block *mb, return -1; } -template <ACE_SYNCH_1> int -ACE_Stream_Tail<ACE_SYNCH_2>::init (int, char *[]) +template <ACE_SYNCH_DECL> int +ACE_Stream_Tail<ACE_SYNCH_USE>::init (int, char *[]) { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::init"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::init"); return 0; } -template <ACE_SYNCH_1> int -ACE_Stream_Tail<ACE_SYNCH_2>::info (char **strp, size_t length) const +template <ACE_SYNCH_DECL> int +ACE_Stream_Tail<ACE_SYNCH_USE>::info (char **strp, size_t length) const { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::info"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::info"); const char *name = this->name (); if (*strp == 0 && (*strp = ACE_OS::strdup (name)) == 0) @@ -281,74 +281,74 @@ ACE_Stream_Tail<ACE_SYNCH_2>::info (char **strp, size_t length) const return ACE_OS::strlen (name); } -template <ACE_SYNCH_1> int -ACE_Stream_Tail<ACE_SYNCH_2>::fini (void) +template <ACE_SYNCH_DECL> int +ACE_Stream_Tail<ACE_SYNCH_USE>::fini (void) { - ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_2>::fini"); + ACE_TRACE ("ACE_Stream_Tail<ACE_SYNCH_USE>::fini"); return 0; } ACE_ALLOC_HOOK_DEFINE(ACE_Thru_Task) -template <ACE_SYNCH_1> -ACE_Thru_Task<ACE_SYNCH_2>::ACE_Thru_Task (void) +template <ACE_SYNCH_DECL> +ACE_Thru_Task<ACE_SYNCH_USE>::ACE_Thru_Task (void) { - ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_2>::ACE_Thru_Task"); + ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::ACE_Thru_Task"); } -template <ACE_SYNCH_1> -ACE_Thru_Task<ACE_SYNCH_2>::~ACE_Thru_Task (void) +template <ACE_SYNCH_DECL> +ACE_Thru_Task<ACE_SYNCH_USE>::~ACE_Thru_Task (void) { - ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_2>::~ACE_Thru_Task"); + ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::~ACE_Thru_Task"); } -template <ACE_SYNCH_1> void -ACE_Thru_Task<ACE_SYNCH_2>::dump (void) const +template <ACE_SYNCH_DECL> void +ACE_Thru_Task<ACE_SYNCH_USE>::dump (void) const { - ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_2>::dump"); + ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::dump"); } -template <ACE_SYNCH_1> int -ACE_Thru_Task<ACE_SYNCH_2>::open (void *) +template <ACE_SYNCH_DECL> int +ACE_Thru_Task<ACE_SYNCH_USE>::open (void *) { - ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_2>::open"); + ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::open"); return 0; } -template <ACE_SYNCH_1> int -ACE_Thru_Task<ACE_SYNCH_2>::close (u_long) +template <ACE_SYNCH_DECL> int +ACE_Thru_Task<ACE_SYNCH_USE>::close (u_long) { - ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_2>::close"); + ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::close"); return 0; } -template <ACE_SYNCH_1> int -ACE_Thru_Task<ACE_SYNCH_2>::svc (void) +template <ACE_SYNCH_DECL> int +ACE_Thru_Task<ACE_SYNCH_USE>::svc (void) { - ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_2>::svc"); + ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::svc"); return -1; } -template <ACE_SYNCH_1> int -ACE_Thru_Task<ACE_SYNCH_2>::put (ACE_Message_Block *msg, +template <ACE_SYNCH_DECL> int +ACE_Thru_Task<ACE_SYNCH_USE>::put (ACE_Message_Block *msg, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_2>::put"); + ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::put"); return this->put_next (msg, tv); } -template <ACE_SYNCH_1> int -ACE_Thru_Task<ACE_SYNCH_2>::init (int, char *[]) +template <ACE_SYNCH_DECL> int +ACE_Thru_Task<ACE_SYNCH_USE>::init (int, char *[]) { - ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_2>::init"); + ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::init"); return 0; } -template <ACE_SYNCH_1> int -ACE_Thru_Task<ACE_SYNCH_2>::info (char **strp, +template <ACE_SYNCH_DECL> int +ACE_Thru_Task<ACE_SYNCH_USE>::info (char **strp, size_t length) const { - ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_2>::info"); + ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::info"); const char *name = this->name (); if (*strp == 0 && (*strp = ACE_OS::strdup (name)) == 0) @@ -358,10 +358,10 @@ ACE_Thru_Task<ACE_SYNCH_2>::info (char **strp, return ACE_OS::strlen (name); } -template <ACE_SYNCH_1> int -ACE_Thru_Task<ACE_SYNCH_2>::fini (void) +template <ACE_SYNCH_DECL> int +ACE_Thru_Task<ACE_SYNCH_USE>::fini (void) { - ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_2>::fini"); + ACE_TRACE ("ACE_Thru_Task<ACE_SYNCH_USE>::fini"); return 0; } diff --git a/ace/Stream_Modules.h b/ace/Stream_Modules.h index 21a149a961a..e4864ae6d3a 100644 --- a/ace/Stream_Modules.h +++ b/ace/Stream_Modules.h @@ -19,8 +19,8 @@ #if !defined (ACE_STREAM_MODULES) #define ACE_STREAM_MODULES -template <ACE_SYNCH_1> -class ACE_Stream_Head : public ACE_Task<ACE_SYNCH_2> +template <ACE_SYNCH_DECL> +class ACE_Stream_Head : public ACE_Task<ACE_SYNCH_USE> // = TITLE // Standard module that acts as the head of a ustream. { @@ -54,8 +54,8 @@ private: // Performs canonical flushing at the ACE_Stream Head. }; -template <ACE_SYNCH_1> -class ACE_Stream_Tail : public ACE_Task<ACE_SYNCH_2> +template <ACE_SYNCH_DECL> +class ACE_Stream_Tail : public ACE_Task<ACE_SYNCH_USE> // = TITLE // Standard module that acts as the head of a ustream. { @@ -89,8 +89,8 @@ private: // Performs canonical flushing at the ACE_Stream tail. }; -template <ACE_SYNCH_1> -class ACE_Thru_Task : public ACE_Task<ACE_SYNCH_2> +template <ACE_SYNCH_DECL> +class ACE_Thru_Task : public ACE_Task<ACE_SYNCH_USE> // = TITLE // Standard module that acts as a "no op", simply passing on all // data to its adjacent neighbor. diff --git a/ace/Svc_Handler.cpp b/ace/Svc_Handler.cpp index 6e4b94d994e..726bed384d7 100644 --- a/ace/Svc_Handler.cpp +++ b/ace/Svc_Handler.cpp @@ -30,18 +30,18 @@ ACE_Svc_Handler_cleanup (void *object, void *) } #endif /* ACE_HAS_SIG_C_FUNC */ -template <PR_ST_1, ACE_SYNCH_1> void -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::cleanup (void *object, void *) +template <PR_ST_1, ACE_SYNCH_DECL> void +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::cleanup (void *object, void *) { ACE_TRACE ("ACE_Svc_Handler::cleanup"); delete (ACE_TSS_TYPE (ACE_Dynamic) *) object; } -template <PR_ST_1, ACE_SYNCH_1> ACE_Dynamic * -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::instance (void) +template <PR_ST_1, ACE_SYNCH_DECL> ACE_Dynamic * +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::instance (void) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::allocated"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::allocated"); static ACE_TSS_TYPE (ACE_Dynamic) *instance_; // Determines if we were dynamically allocated. Note that this @@ -71,20 +71,20 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::instance (void) return ACE_TSS_GET (instance_, ACE_Dynamic); } -template <PR_ST_1, ACE_SYNCH_1> void * -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::operator new (size_t n) +template <PR_ST_1, ACE_SYNCH_DECL> void * +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::operator new (size_t n) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::operator new"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::operator new"); // Allocate the memory and store it (usually in thread-specific // storage, depending on config flags). - ACE_Svc_Handler<ACE_PEER_STREAM_2, ACE_SYNCH_2>::instance ()->set (); + ACE_Svc_Handler<ACE_PEER_STREAM_2, ACE_SYNCH_USE>::instance ()->set (); return ::new char[n]; } -template <PR_ST_1, ACE_SYNCH_1> void -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::destroy (void) +template <PR_ST_1, ACE_SYNCH_DECL> void +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::destroy (void) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::destroy"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::destroy"); // Only delete ourselves if we've been allocated dynamically. if (this->dynamic_ && this->closing_ == 0) @@ -95,10 +95,10 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::destroy (void) delete this; } -template <PR_ST_1, ACE_SYNCH_1> void -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::operator delete (void *obj) +template <PR_ST_1, ACE_SYNCH_DECL> void +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::operator delete (void *obj) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::delete"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::delete"); // You cannot delete a 'void*' (X3J16/95-0087 5.3.5.3), but we know // the pointer was created using new char[] (see operator new code), // so we use a cast: @@ -108,16 +108,16 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::operator delete (void *obj) // Default constructor. -template <PR_ST_1, ACE_SYNCH_1> -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::ACE_Svc_Handler (ACE_Thread_Manager *tm, - ACE_Message_Queue<ACE_SYNCH_2> *mq, +template <PR_ST_1, ACE_SYNCH_DECL> +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::ACE_Svc_Handler (ACE_Thread_Manager *tm, + ACE_Message_Queue<ACE_SYNCH_USE> *mq, ACE_Reactor *reactor) - : ACE_Task<ACE_SYNCH_2> (tm, mq), + : ACE_Task<ACE_SYNCH_USE> (tm, mq), closing_ (0), recycler_ (0), recycling_act_ (0) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::ACE_Svc_Handler"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::ACE_Svc_Handler"); this->reactor (reactor); @@ -129,19 +129,19 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::ACE_Svc_Handler (ACE_Thread_Manager *tm, // work correctly in multi-threaded programs by using our ACE_TSS // class. this->dynamic_ = - ACE_Svc_Handler<ACE_PEER_STREAM_2, ACE_SYNCH_2>::instance()->is_dynamic (); + ACE_Svc_Handler<ACE_PEER_STREAM_2, ACE_SYNCH_USE>::instance()->is_dynamic (); if (this->dynamic_) // Make sure to reset the flag - ACE_Svc_Handler<ACE_PEER_STREAM_2, ACE_SYNCH_2>::instance()->reset (); + ACE_Svc_Handler<ACE_PEER_STREAM_2, ACE_SYNCH_USE>::instance()->reset (); } // Default behavior for a ACE_Svc_Handler object is to be registered with // the ACE_Reactor (thereby ensuring single threading). -template <PR_ST_1, ACE_SYNCH_1> int -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::open (void *) +template <PR_ST_1, ACE_SYNCH_DECL> int +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::open (void *) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::open"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::open"); #if defined (DEBUGGING) char buf[BUFSIZ]; ACE_PEER_STREAM_ADDR client_addr; @@ -166,10 +166,10 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::open (void *) // Perform termination activities. -template <PR_ST_1, ACE_SYNCH_1> void -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::shutdown (void) +template <PR_ST_1, ACE_SYNCH_DECL> void +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::shutdown (void) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::shutdown"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::shutdown"); // Deregister this handler with the ACE_Reactor. if (this->reactor ()) @@ -191,41 +191,41 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::shutdown (void) this->peer ().close (); } -template <PR_ST_1, ACE_SYNCH_1> void -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::dump (void) const +template <PR_ST_1, ACE_SYNCH_DECL> void +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::dump (void) const { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::dump"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::dump"); } -template <PR_ST_1, ACE_SYNCH_1> ACE_PEER_STREAM & -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::peer (void) const +template <PR_ST_1, ACE_SYNCH_DECL> ACE_PEER_STREAM & +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::peer (void) const { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::peer"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::peer"); return (ACE_PEER_STREAM &) this->peer_; } // Extract the underlying I/O descriptor. -template <PR_ST_1, ACE_SYNCH_1> ACE_HANDLE -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::get_handle (void) const +template <PR_ST_1, ACE_SYNCH_DECL> ACE_HANDLE +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::get_handle (void) const { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::get_handle"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::get_handle"); return this->peer_.get_handle (); } // Set the underlying I/O descriptor. -template <PR_ST_1, ACE_SYNCH_1> void -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::set_handle (ACE_HANDLE h) +template <PR_ST_1, ACE_SYNCH_DECL> void +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::set_handle (ACE_HANDLE h) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::set_handle"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::set_handle"); this->peer_.set_handle (h); } -template <PR_ST_1, ACE_SYNCH_1> -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::~ACE_Svc_Handler (void) +template <PR_ST_1, ACE_SYNCH_DECL> +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::~ACE_Svc_Handler (void) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::~ACE_Svc_Handler"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::~ACE_Svc_Handler"); if (this->closing_ == 0) { @@ -238,54 +238,54 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::~ACE_Svc_Handler (void) } } -template <PR_ST_1, ACE_SYNCH_1> int -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::handle_close (ACE_HANDLE, +template <PR_ST_1, ACE_SYNCH_DECL> int +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::handle_close (ACE_HANDLE, ACE_Reactor_Mask) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::handle_close"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::handle_close"); this->destroy (); return 0; } -template <PR_ST_1, ACE_SYNCH_1> int -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::handle_timeout (const ACE_Time_Value &, +template <PR_ST_1, ACE_SYNCH_DECL> int +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::handle_timeout (const ACE_Time_Value &, const void *) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::handle_timeout"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::handle_timeout"); return this->handle_close (); } -template <PR_ST_1, ACE_SYNCH_1> int -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::close (unsigned long) +template <PR_ST_1, ACE_SYNCH_DECL> int +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::close (unsigned long) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::close"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::close"); return this->handle_close (); } -template <PR_ST_1, ACE_SYNCH_1> int -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::init (int, char *[]) +template <PR_ST_1, ACE_SYNCH_DECL> int +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::init (int, char *[]) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::init"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::init"); return -1; } -template <PR_ST_1, ACE_SYNCH_1> int -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::fini (void) +template <PR_ST_1, ACE_SYNCH_DECL> int +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::fini (void) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::fini"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::fini"); return -1; } -template <PR_ST_1, ACE_SYNCH_1> int -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::info (char **, size_t) const +template <PR_ST_1, ACE_SYNCH_DECL> int +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::info (char **, size_t) const { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::info"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::info"); return -1; } -template <PR_ST_1, ACE_SYNCH_1> int -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::idle (u_long flags) +template <PR_ST_1, ACE_SYNCH_DECL> int +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::idle (u_long flags) { if (this->recycler ()) return this->recycler ()->cache (this->recycling_act_); @@ -293,26 +293,26 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::idle (u_long flags) return this->close (flags); } -template <PR_ST_1, ACE_SYNCH_1> void -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::recycler (ACE_Connection_Recycling_Strategy *recycler, +template <PR_ST_1, ACE_SYNCH_DECL> void +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::recycler (ACE_Connection_Recycling_Strategy *recycler, const void *recycling_act) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::recycler"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::recycler"); this->recycler_ = recycler; this->recycling_act_ = recycling_act; } -template <PR_ST_1, ACE_SYNCH_1> ACE_Connection_Recycling_Strategy * -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::recycler (void) const +template <PR_ST_1, ACE_SYNCH_DECL> ACE_Connection_Recycling_Strategy * +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::recycler (void) const { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::recycler"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::recycler"); return this->recycler_; } -template <PR_ST_1, ACE_SYNCH_1> int -ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::recycle (void *) +template <PR_ST_1, ACE_SYNCH_DECL> int +ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::recycle (void *) { - ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::recycle"); + ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::recycle"); // By default, the object is ready and willing to be recycled. return 0; } diff --git a/ace/Svc_Handler.h b/ace/Svc_Handler.h index 8e84b702298..e5f616cb7ed 100644 --- a/ace/Svc_Handler.h +++ b/ace/Svc_Handler.h @@ -26,8 +26,8 @@ class ACE_Connection_Recycling_Strategy; #include "ace/Service_Config.h" #include "ace/Synch_T.h" -template <ACE_PEER_STREAM_1, ACE_SYNCH_1> -class ACE_Svc_Handler : public ACE_Task<ACE_SYNCH_2> +template <ACE_PEER_STREAM_1, ACE_SYNCH_DECL> +class ACE_Svc_Handler : public ACE_Task<ACE_SYNCH_USE> // = TITLE // Defines the interface for a service that exchanges data with // its connected peer. @@ -46,7 +46,7 @@ class ACE_Svc_Handler : public ACE_Task<ACE_SYNCH_2> public: // = Initialization and termination methods. ACE_Svc_Handler (ACE_Thread_Manager * = 0, - ACE_Message_Queue<ACE_SYNCH_2> * = 0, + ACE_Message_Queue<ACE_SYNCH_USE> * = 0, ACE_Reactor * = ACE_Reactor::instance ()); virtual ~ACE_Svc_Handler (void); diff --git a/ace/Synch_T.h b/ace/Synch_T.h index e65af45549d..06ab1884531 100644 --- a/ace/Synch_T.h +++ b/ace/Synch_T.h @@ -771,7 +771,7 @@ public: #define ACE_SYNCH_NULL_SEMAPHORE ACE_SYNCH::NULL_SEMAPHORE #define ACE_SYNCH_SEMAPHORE ACE_SYNCH::SEMAPHORE -#else /* ACE_HAS_TEMPLATE_TYPEDEFS */ +#else /* !ACE_HAS_TEMPLATE_TYPEDEFS */ #if defined (ACE_HAS_OPTIMIZED_MESSAGE_QUEUE) #define ACE_NULL_SYNCH ACE_Null_Mutex, ACE_Null_Condition, ACE_Null_Mutex diff --git a/ace/Task_T.cpp b/ace/Task_T.cpp index a891ba3a6d4..cfbdfcdfb66 100644 --- a/ace/Task_T.cpp +++ b/ace/Task_T.cpp @@ -13,10 +13,10 @@ #include "ace/Task_T.i" #endif /* __ACE_INLINE__ */ -template <ACE_SYNCH_1> void -ACE_Task<ACE_SYNCH_2>::dump (void) const +template <ACE_SYNCH_DECL> void +ACE_Task<ACE_SYNCH_USE>::dump (void) const { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::dump"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, "\nthr_mgr_ = %x", this->thr_mgr_)); this->msg_queue_->dump (); @@ -36,30 +36,30 @@ ACE_Task<ACE_SYNCH_2>::dump (void) const // If the user doesn't supply a ACE_Message_Queue pointer then we'll // allocate one dynamically. Otherwise, we'll use the one they give. -template<ACE_SYNCH_1> -ACE_Task<ACE_SYNCH_2>::ACE_Task (ACE_Thread_Manager *thr_man, - ACE_Message_Queue<ACE_SYNCH_2> *mq) +template<ACE_SYNCH_DECL> +ACE_Task<ACE_SYNCH_USE>::ACE_Task (ACE_Thread_Manager *thr_man, + ACE_Message_Queue<ACE_SYNCH_USE> *mq) : ACE_Task_Base (thr_man), msg_queue_ (0), delete_msg_queue_ (0), mod_ (0), next_ (0) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::ACE_Task"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::ACE_Task"); if (mq == 0) { - ACE_NEW (mq, ACE_Message_Queue<ACE_SYNCH_2>); + ACE_NEW (mq, ACE_Message_Queue<ACE_SYNCH_USE>); this->delete_msg_queue_ = 1; } this->msg_queue_ = mq; } -template<ACE_SYNCH_1> -ACE_Task<ACE_SYNCH_2>::~ACE_Task (void) +template<ACE_SYNCH_DECL> +ACE_Task<ACE_SYNCH_USE>::~ACE_Task (void) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::~ACE_Task"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::~ACE_Task"); if (this->delete_msg_queue_) delete this->msg_queue_; @@ -68,30 +68,30 @@ ACE_Task<ACE_SYNCH_2>::~ACE_Task (void) this->delete_msg_queue_ = 0; } -template<ACE_SYNCH_1> ACE_Task<ACE_SYNCH_2> * -ACE_Task<ACE_SYNCH_2>::sibling (void) +template<ACE_SYNCH_DECL> ACE_Task<ACE_SYNCH_USE> * +ACE_Task<ACE_SYNCH_USE>::sibling (void) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::sibling"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::sibling"); if (this->mod_ == 0) return 0; else return this->mod_->sibling (this); } -template<ACE_SYNCH_1> const char * -ACE_Task<ACE_SYNCH_2>::name (void) const +template<ACE_SYNCH_DECL> const char * +ACE_Task<ACE_SYNCH_USE>::name (void) const { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::name"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::name"); if (this->mod_ == 0) return 0; else return this->mod_->name (); } -template<ACE_SYNCH_1> ACE_Module<ACE_SYNCH_2> * -ACE_Task<ACE_SYNCH_2>::module (void) const +template<ACE_SYNCH_DECL> ACE_Module<ACE_SYNCH_USE> * +ACE_Task<ACE_SYNCH_USE>::module (void) const { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::module"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::module"); return this->mod_; } diff --git a/ace/Task_T.h b/ace/Task_T.h index 9549a05b90b..a1a1496eef1 100644 --- a/ace/Task_T.h +++ b/ace/Task_T.h @@ -22,9 +22,9 @@ #include "ace/Task.h" // Forward decls... -template <ACE_SYNCH_1> class ACE_Module; +template <ACE_SYNCH_DECL> class ACE_Module; -template <ACE_SYNCH_1> +template <ACE_SYNCH_DECL> class ACE_Task : public ACE_Task_Base // = TITLE // Primary interface for application message processing, as well @@ -34,12 +34,12 @@ class ACE_Task : public ACE_Task_Base // This class serves as the basis for passive and active objects // in ACE. { -friend class ACE_Module<ACE_SYNCH_2>; +friend class ACE_Module<ACE_SYNCH_USE>; friend class ACE_Module_Type; public: // = Initialization/termination methods. ACE_Task (ACE_Thread_Manager *thr_mgr = 0, - ACE_Message_Queue<ACE_SYNCH_2> *mq = 0); + ACE_Message_Queue<ACE_SYNCH_USE> *mq = 0); // Initialize a Task, supplying a thread manager and a message // queue. If the user doesn't supply a ACE_Message_Queue pointer // then we'll allocate one dynamically. Otherwise, we'll use the @@ -48,10 +48,10 @@ public: virtual ~ACE_Task (void); // Destructor. - ACE_Message_Queue<ACE_SYNCH_2> *msg_queue (void); + ACE_Message_Queue<ACE_SYNCH_USE> *msg_queue (void); // Gets the message queue associated with this task. - void msg_queue (ACE_Message_Queue<ACE_SYNCH_2> *); + void msg_queue (ACE_Message_Queue<ACE_SYNCH_USE> *); // Sets the message queue associated with this task. public: // Should be protected: @@ -81,16 +81,16 @@ public: // Should be protected: // with the Task, else returns 0. // = Pointers to next ACE_Task_Base (if ACE is part of an ACE_Stream). - ACE_Task<ACE_SYNCH_2> *next (void); + ACE_Task<ACE_SYNCH_USE> *next (void); // Get next Task pointer. - void next (ACE_Task<ACE_SYNCH_2> *); + void next (ACE_Task<ACE_SYNCH_USE> *); // Set next Task pointer. - ACE_Task<ACE_SYNCH_2> *sibling (void); + ACE_Task<ACE_SYNCH_USE> *sibling (void); // Return the Task's sibling if there's one associated with the // Task's Module, else returns 0. - ACE_Module<ACE_SYNCH_2> *module (void) const; + ACE_Module<ACE_SYNCH_USE> *module (void) const; // Return the Task's Module if there is one, else returns 0. int flush (u_long flag = ACE_Task_Flags::ACE_FLUSHALL); @@ -103,16 +103,16 @@ public: // Should be protected: void water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, size_t); // Manipulate watermarks. - ACE_Message_Queue<ACE_SYNCH_2> *msg_queue_; + ACE_Message_Queue<ACE_SYNCH_USE> *msg_queue_; // List of messages on the ACE_Task.. int delete_msg_queue_; // 1 if should delete Message_Queue, 0 otherwise. - ACE_Module<ACE_SYNCH_2> *mod_; + ACE_Module<ACE_SYNCH_USE> *mod_; // Back-pointer to the enclosing module. - ACE_Task<ACE_SYNCH_2> *next_; + ACE_Task<ACE_SYNCH_USE> *next_; // Pointer to adjacent ACE_Task. void dump (void) const; diff --git a/ace/Task_T.i b/ace/Task_T.i index f1a1ce29a06..1a78650279f 100644 --- a/ace/Task_T.i +++ b/ace/Task_T.i @@ -3,60 +3,60 @@ // Task_T.i -template <ACE_SYNCH_1> ACE_INLINE void -ACE_Task<ACE_SYNCH_2>::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, +template <ACE_SYNCH_DECL> ACE_INLINE void +ACE_Task<ACE_SYNCH_USE>::water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, size_t wm_size) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::water_marks"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::water_marks"); if (cmd == ACE_IO_Cntl_Msg::SET_LWM) this->msg_queue_->low_water_mark (wm_size); else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */ this->msg_queue_->high_water_mark (wm_size); } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Task<ACE_SYNCH_2>::getq (ACE_Message_Block *&mb, ACE_Time_Value *tv) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Task<ACE_SYNCH_USE>::getq (ACE_Message_Block *&mb, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::getq"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::getq"); return this->msg_queue_->dequeue_head (mb, tv); } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Task<ACE_SYNCH_2>::can_put (ACE_Message_Block *) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Task<ACE_SYNCH_USE>::can_put (ACE_Message_Block *) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::can_put"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::can_put"); assert (!"not implemented"); return -1; } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Task<ACE_SYNCH_2>::putq (ACE_Message_Block *mb, ACE_Time_Value *tv) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Task<ACE_SYNCH_USE>::putq (ACE_Message_Block *mb, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::putq"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::putq"); return this->msg_queue_->enqueue_tail (mb, tv); } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Task<ACE_SYNCH_2>::ungetq (ACE_Message_Block *mb, ACE_Time_Value *tv) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Task<ACE_SYNCH_USE>::ungetq (ACE_Message_Block *mb, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::ungetq"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::ungetq"); return this->msg_queue_->enqueue_head (mb, tv); } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Task<ACE_SYNCH_2>::flush (u_long flag) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Task<ACE_SYNCH_USE>::flush (u_long flag) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::flush"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::flush"); if (ACE_BIT_ENABLED (flag, ACE_Task_Flags::ACE_FLUSHALL)) return this->msg_queue_ != 0 && this->msg_queue_->close (); else return -1; // Note, need to be more careful about what we free... } -template <ACE_SYNCH_1> ACE_INLINE void -ACE_Task<ACE_SYNCH_2>::msg_queue (ACE_Message_Queue<ACE_SYNCH_2> *mq) +template <ACE_SYNCH_DECL> ACE_INLINE void +ACE_Task<ACE_SYNCH_USE>::msg_queue (ACE_Message_Queue<ACE_SYNCH_USE> *mq) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::msg_queue"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::msg_queue"); if (this->delete_msg_queue_) { delete this->msg_queue_; @@ -65,39 +65,39 @@ ACE_Task<ACE_SYNCH_2>::msg_queue (ACE_Message_Queue<ACE_SYNCH_2> *mq) this->msg_queue_ = mq; } -template <ACE_SYNCH_1> ACE_Message_Queue<ACE_SYNCH_2> * -ACE_Task<ACE_SYNCH_2>::msg_queue (void) +template <ACE_SYNCH_DECL> ACE_Message_Queue<ACE_SYNCH_USE> * +ACE_Task<ACE_SYNCH_USE>::msg_queue (void) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::msg_queue"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::msg_queue"); return this->msg_queue_; } -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Task<ACE_SYNCH_2>::reply (ACE_Message_Block *mb, ACE_Time_Value *tv) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Task<ACE_SYNCH_USE>::reply (ACE_Message_Block *mb, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::reply"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::reply"); return this->sibling ()->put_next (mb, tv); } -template <ACE_SYNCH_1> ACE_INLINE ACE_Task<ACE_SYNCH_2> * -ACE_Task<ACE_SYNCH_2>::next (void) +template <ACE_SYNCH_DECL> ACE_INLINE ACE_Task<ACE_SYNCH_USE> * +ACE_Task<ACE_SYNCH_USE>::next (void) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::next"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::next"); return this->next_; } -template <ACE_SYNCH_1> ACE_INLINE void -ACE_Task<ACE_SYNCH_2>::next (ACE_Task<ACE_SYNCH_2> *q) +template <ACE_SYNCH_DECL> ACE_INLINE void +ACE_Task<ACE_SYNCH_USE>::next (ACE_Task<ACE_SYNCH_USE> *q) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::next"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::next"); this->next_ = q; } // Transfer msg to the next ACE_Task. -template <ACE_SYNCH_1> ACE_INLINE int -ACE_Task<ACE_SYNCH_2>::put_next (ACE_Message_Block *msg, ACE_Time_Value *tv) +template <ACE_SYNCH_DECL> ACE_INLINE int +ACE_Task<ACE_SYNCH_USE>::put_next (ACE_Message_Block *msg, ACE_Time_Value *tv) { - ACE_TRACE ("ACE_Task<ACE_SYNCH_2>::put_next"); + ACE_TRACE ("ACE_Task<ACE_SYNCH_USE>::put_next"); return this->next_ == 0 ? -1 : this->next_->put (msg, tv); } diff --git a/ace/UNIX_Addr.cpp b/ace/UNIX_Addr.cpp index 5ce54752cf8..0b3df7354d3 100644 --- a/ace/UNIX_Addr.cpp +++ b/ace/UNIX_Addr.cpp @@ -34,21 +34,23 @@ ACE_UNIX_Addr::dump (void) const ACE_UNIX_Addr::ACE_UNIX_Addr (void) : ACE_Addr (AF_UNIX, sizeof this->unix_addr_) { - (void) ACE_OS::memset ((void *) &this->unix_addr_, 0, sizeof this->unix_addr_); + (void) ACE_OS::memset ((void *) &this->unix_addr_, + 0, + sizeof this->unix_addr_); } int ACE_UNIX_Addr::set (const ACE_UNIX_Addr &sa) { - size_t size = sa.get_size (); - - // Add one extra byte to account for the NUL at the end of the - // pathname. - if (size < sizeof this->unix_addr_) - size = sa.get_size () + 1; - - this->unix_addr_.sun_family = AF_UNIX; - ACE_OS::strcpy (this->unix_addr_.sun_path, sa.unix_addr_.sun_path); + this->base_set (sa.get_type (), sa.get_size ()); + + if (sa.get_type () == AF_ANY) + (void) ACE_OS::memset ((void *) &this->unix_addr_, + 0, + sizeof this->unix_addr_); + else + ACE_OS::strcpy (this->unix_addr_.sun_path, + sa.unix_addr_.sun_path); return 0; } @@ -93,7 +95,7 @@ ACE_UNIX_Addr::set (const char rendezvous_point[]) this->ACE_Addr::base_set (AF_UNIX, sizeof this->unix_addr_ - sizeof (this->unix_addr_.sun_path) + - ACE_OS::strlen (this->unix_addr_.sun_path) ); + ACE_OS::strlen (this->unix_addr_.sun_path)); return 0; } |