diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-04-09 07:27:30 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-04-09 07:27:30 +0000 |
commit | b648d4f80727ac9e040517fb8db7e633fde6da9d (patch) | |
tree | 4b4c0a1f0ad2f1f19634c57831be9da3c3dc45a1 | |
parent | 62760474cc7fa10f18a94433e730bcefe210b1e8 (diff) | |
download | ATCD-b648d4f80727ac9e040517fb8db7e633fde6da9d.tar.gz |
Wed Apr 9 07:18:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | ACE/ChangeLog | 30 | ||||
-rw-r--r-- | ACE/ace/Based_Pointer_T.h | 6 | ||||
-rw-r--r-- | ACE/ace/High_Res_Timer.h | 2 | ||||
-rw-r--r-- | ACE/ace/MMAP_Memory_Pool.cpp | 27 | ||||
-rw-r--r-- | ACE/ace/MMAP_Memory_Pool.h | 23 | ||||
-rw-r--r-- | ACE/ace/Naming_Context.cpp | 40 | ||||
-rw-r--r-- | ACE/ace/OS_NS_errno.h | 2 | ||||
-rw-r--r-- | ACE/ace/Select_Reactor_T.cpp | 8 | ||||
-rw-r--r-- | ACE/ace/Service_Config.h | 2 | ||||
-rw-r--r-- | ACE/ace/Service_Gestalt.cpp | 8 |
10 files changed, 101 insertions, 47 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 6310449cce1..3ed34afde2e 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,31 @@ +Wed Apr 9 07:18:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ace/Service_Config.h: + Export ACE_Threading_Helper, it is used as protected class + member + + * ace/Service_Gestalt.cpp: + Don't use ACE_LIB_TEXT + + * ace/High_Res_Timer.h: + * ace/Based_Pointer_T.h: + Doxygen changes + + * ace/Naming_Context.cpp: + Fixed gcc 4.3 warning + + * ace/OS_NS_errno.h (last_error): + Give the argument a name so that doxygen can do its work + + * ace/Select_Reactor_T.cpp: + Use scoping + + * ace/MMAP_Memory_Pool.{h,cpp}: + Add a bool flag to indicate whether the signal handler has to + be installed or not. Made some other flags bool and win32 there + is no need have a signal handler as member. This fixes bugzilla + 3290 + Wed Apr 9 02:43:37 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> * ace/Dynamic_Service.inl (instance): @@ -19,7 +47,7 @@ Wed Apr 9 01:21:42 UTC 2008 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu> * ace/Condition_T.cpp (wait): Fixed a bug where the mutex parameter wasn't being used properly if abstime was 0. Thanks - to Andriy Gapon <avg at icyb dot net dot ua> for reporting this. + to Andriy Gapon <avg at icyb dot net dot ua> for reporting this. Mon Apr 7 18:49:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> diff --git a/ACE/ace/Based_Pointer_T.h b/ACE/ace/Based_Pointer_T.h index bb5874f002f..22653799b40 100644 --- a/ACE/ace/Based_Pointer_T.h +++ b/ACE/ace/Based_Pointer_T.h @@ -64,7 +64,7 @@ public: ACE_Based_Pointer_Basic (void); /** - * Initialize this object using the <initial> pointer. This + * Initialize this object using the @a initial pointer. This * constructor initializes the <base_offset_> by asking the * <ACE_BASED_POINTER_REPOSITORY> Singleton for the base address of * the memory region within which it is instantiated. Three results @@ -81,7 +81,7 @@ public: * based-pointer uses its address as an offset to its base * address 0. * - * 3. If <initial> is 0 then set the value of <target_> to -1, which + * 3. If @a initial is 0 then set the value of <target_> to -1, which * indicates a "NULL" pointer. */ ACE_Based_Pointer_Basic (CONCRETE *initial); @@ -89,7 +89,7 @@ public: /// Copy constructor. ACE_Based_Pointer_Basic (const ACE_Based_Pointer_Basic<CONCRETE> &); - /// Constructor for know base address. <o> is only used to + /// Constructor for know base address. @a o is only used to /// resolve overload ambiguity. ACE_Based_Pointer_Basic (const void *base_addr, int o); diff --git a/ACE/ace/High_Res_Timer.h b/ACE/ace/High_Res_Timer.h index 4fa0b64c391..642ffc796c5 100644 --- a/ACE/ace/High_Res_Timer.h +++ b/ACE/ace/High_Res_Timer.h @@ -125,7 +125,7 @@ public: #endif /* ACE_HR_SCALE_CONVERSION */ /** - * Sets the global_scale_factor to the value in the <env> + * Sets the global_scale_factor to the value in the @a env * environment variable. Returns 0 on success, -1 on failure. * @note If @a env points to string "0" (value zero), this call will fail. * This is basically a no-op on CE because there is no concept of diff --git a/ACE/ace/MMAP_Memory_Pool.cpp b/ACE/ace/MMAP_Memory_Pool.cpp index 1051b33d9ec..e77c1205993 100644 --- a/ACE/ace/MMAP_Memory_Pool.cpp +++ b/ACE/ace/MMAP_Memory_Pool.cpp @@ -119,10 +119,11 @@ ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool ( : base_addr_ (0), use_fixed_addr_(0), flags_ (MAP_SHARED), - write_each_page_ (0), + write_each_page_ (false), minimum_bytes_ (0), sa_ (0), - file_mode_ (ACE_DEFAULT_FILE_PERMS) + file_mode_ (ACE_DEFAULT_FILE_PERMS), + install_signal_handler_ (true) { ACE_TRACE ("ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool"); @@ -156,6 +157,7 @@ ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool ( if (options->sa_ != 0) this->sa_ = options->sa_; this->file_mode_ = options->file_mode_; + this->install_signal_handler_ = options->install_signal_handler_; } if (backing_store_name == 0) @@ -192,9 +194,12 @@ ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool ( (sizeof this->backing_store_name_ / sizeof (ACE_TCHAR))); #if !defined (ACE_WIN32) - if (this->signal_handler_.register_handler (SIGSEGV, this) == -1) - ACE_ERROR ((LM_ERROR, - "%p\n", this->backing_store_name_)); + if (this->install_signal_handler_) + { + if (this->signal_handler_.register_handler (SIGSEGV, this) == -1) + ACE_ERROR ((LM_ERROR, + "%p\n", this->backing_store_name_)); + } #endif /* ACE_WIN32 */ } @@ -438,13 +443,14 @@ ACE_MMAP_Memory_Pool::remap (void *addr) ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options ( const void *base_addr, int use_fixed_addr, - int write_each_page, + bool write_each_page, size_t minimum_bytes, u_int flags, - int guess_on_fault, + bool guess_on_fault, LPSECURITY_ATTRIBUTES sa, mode_t file_mode, - bool unique) + bool unique, + bool install_signal_handler) : base_addr_ (base_addr), use_fixed_addr_ (use_fixed_addr), write_each_page_ (write_each_page), @@ -453,7 +459,8 @@ ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options ( guess_on_fault_ (guess_on_fault), sa_ (sa), file_mode_ (file_mode), - unique_ (unique) + unique_ (unique), + install_signal_handler_ (install_signal_handler) { ACE_TRACE ("ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options"); // for backwards compatability @@ -471,6 +478,7 @@ ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options ( // update the mapping accordingly. When the signal handler returns, // the instruction should be restarted and the operation should work. +#if !defined (ACE_WIN32) int ACE_MMAP_Memory_Pool::handle_signal (int signum, siginfo_t *siginfo, ucontext_t *) { @@ -526,6 +534,7 @@ ACE_MMAP_Memory_Pool::handle_signal (int signum, siginfo_t *siginfo, ucontext_t else return -1; } +#endif void * ACE_MMAP_Memory_Pool::base_addr (void) const diff --git a/ACE/ace/MMAP_Memory_Pool.h b/ACE/ace/MMAP_Memory_Pool.h index ede22814183..912b86c5ba1 100644 --- a/ACE/ace/MMAP_Memory_Pool.h +++ b/ACE/ace/MMAP_Memory_Pool.h @@ -63,16 +63,17 @@ public: NEVER_FIXED = 2 }; - // = Initialization method. + /// Constructor ACE_MMAP_Memory_Pool_Options (const void *base_addr = ACE_DEFAULT_BASE_ADDR, int use_fixed_addr = ALWAYS_FIXED, - int write_each_page = 1, + bool write_each_page = true, size_t minimum_bytes = 0, u_int flags = 0, - int guess_on_fault = 1, + bool guess_on_fault = true, LPSECURITY_ATTRIBUTES sa = 0, mode_t file_mode = ACE_DEFAULT_FILE_PERMS, - bool unique_ = false); + bool unique_ = false, + bool install_signal_handler = true); /// Base address of the memory-mapped backing store. const void *base_addr_; @@ -93,7 +94,7 @@ public: /// Should each page be written eagerly to avoid surprises later /// on? - int write_each_page_; + bool write_each_page_; /// What the minimim bytes of the initial segment should be. size_t minimum_bytes_; @@ -117,6 +118,9 @@ public: /// Do we want an unique backing store name? bool unique_; + /// Should we install a signal handler + bool install_signal_handler_; + private: // Prevent copying ACE_MMAP_Memory_Pool_Options (const ACE_MMAP_Memory_Pool_Options &); @@ -238,12 +242,16 @@ protected: /// Memory map the file up to @a map_size bytes. virtual int map_file (size_t map_size); +#if !defined (ACE_WIN32) /// Handle SIGSEGV and SIGBUS signals to remap shared memory /// properly. virtual int handle_signal (int signum, siginfo_t *, ucontext_t *); +#endif +#if !defined (ACE_WIN32) /// Handles SIGSEGV. ACE_Sig_Handler signal_handler_; +#endif /// Memory-mapping object. ACE_Mem_Map mmap_; @@ -263,7 +271,7 @@ protected: /// Should we write a byte to each page to forceably allocate memory /// for this backing store? - int write_each_page_; + bool write_each_page_; /// What the minimum bytes of the initial segment should be. size_t minimum_bytes_; @@ -283,6 +291,9 @@ protected: /// Protection mode for mmaped file. mode_t file_mode_; + + /// Should we install a signal handler + bool install_signal_handler_; }; /** diff --git a/ACE/ace/Naming_Context.cpp b/ACE/ace/Naming_Context.cpp index 71602de6b44..b50af0285f8 100644 --- a/ACE/ace/Naming_Context.cpp +++ b/ACE/ace/Naming_Context.cpp @@ -85,27 +85,29 @@ ACE_Naming_Context::open (Context_Scope_Type scope_in, int lite) -1); #endif /* ACE_WIN32 && ACE_USES_WCHAR */ if (!this->name_options_->use_registry ()) - if (scope_in == ACE_Naming_Context::NET_LOCAL && this->local () == 0) - { - // Use NET_LOCAL name space, set up connection with remote server. - ACE_NEW_RETURN (this->name_space_, - ACE_Remote_Name_Space (this->netnameserver_host_, - (u_short) this->netnameserver_port_), - -1); - } - else // Use NODE_LOCAL or PROC_LOCAL name space. - { - if (lite) - ACE_NEW_RETURN (this->name_space_, - LITE_LOCAL_NAME_SPACE (scope_in, - this->name_options_), - -1); - else + { + if (scope_in == ACE_Naming_Context::NET_LOCAL && this->local () == 0) + { + // Use NET_LOCAL name space, set up connection with remote server. ACE_NEW_RETURN (this->name_space_, - LOCAL_NAME_SPACE (scope_in, - this->name_options_), + ACE_Remote_Name_Space (this->netnameserver_host_, + (u_short) this->netnameserver_port_), -1); - } + } + else // Use NODE_LOCAL or PROC_LOCAL name space. + { + if (lite) + ACE_NEW_RETURN (this->name_space_, + LITE_LOCAL_NAME_SPACE (scope_in, + this->name_options_), + -1); + else + ACE_NEW_RETURN (this->name_space_, + LOCAL_NAME_SPACE (scope_in, + this->name_options_), + -1); + } + } if (ACE_LOG_MSG->op_status () != 0 || this->name_space_ == 0) ACE_ERROR_RETURN ((LM_ERROR, diff --git a/ACE/ace/OS_NS_errno.h b/ACE/ace/OS_NS_errno.h index 85e85735b2c..5dcb0f3aa59 100644 --- a/ACE/ace/OS_NS_errno.h +++ b/ACE/ace/OS_NS_errno.h @@ -41,7 +41,7 @@ namespace ACE_OS { int last_error (void); ACE_NAMESPACE_INLINE_FUNCTION - void last_error (int); + void last_error (int error); ACE_NAMESPACE_INLINE_FUNCTION int set_errno_to_last_error (void); diff --git a/ACE/ace/Select_Reactor_T.cpp b/ACE/ace/Select_Reactor_T.cpp index 0d94dffdba3..efdf2cec04d 100644 --- a/ACE/ace/Select_Reactor_T.cpp +++ b/ACE/ace/Select_Reactor_T.cpp @@ -241,7 +241,9 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::suspend_handlers (void) for (ACE_Select_Reactor_Handler_Repository_Iterator iter (&this->handler_rep_); iter.next (eh) != 0; iter.advance ()) - this->suspend_i (eh->get_handle ()); + { + this->suspend_i (eh->get_handle ()); + } return 0; } @@ -257,7 +259,9 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::resume_handlers (void) for (ACE_Select_Reactor_Handler_Repository_Iterator iter (&this->handler_rep_); iter.next (eh) != 0; iter.advance ()) - this->resume_i (eh->get_handle ()); + { + this->resume_i (eh->get_handle ()); + } return 0; } diff --git a/ACE/ace/Service_Config.h b/ACE/ace/Service_Config.h index 1ecfce042f8..5a1a74be512 100644 --- a/ACE/ace/Service_Config.h +++ b/ACE/ace/Service_Config.h @@ -142,7 +142,7 @@ public: * parent thread's gestalt. Designed to be used as an instance member * of @c ACE_Service_Config */ -class ACE_Threading_Helper +class ACE_Export ACE_Threading_Helper { public: ACE_Threading_Helper (); diff --git a/ACE/ace/Service_Gestalt.cpp b/ACE/ace/Service_Gestalt.cpp index 6b10f129cb6..6dfedf676a9 100644 --- a/ACE/ace/Service_Gestalt.cpp +++ b/ACE/ace/Service_Gestalt.cpp @@ -544,8 +544,8 @@ ACE_Service_Gestalt::initialize (const ACE_Service_Type_Factory *stf, #ifndef ACE_NLOGGING if (ACE::debug ()) ACE_DEBUG ((LM_WARNING, - ACE_LIB_TEXT ("ACE (%P|%t) SG::initialize - repo=%@,") - ACE_LIB_TEXT (" name=%s - removing a pre-existing namesake.\n"), + ACE_TEXT ("ACE (%P|%t) SG::initialize - repo=%@,") + ACE_TEXT (" name=%s - removing a pre-existing namesake.\n"), this->repo_, stf->name ())); #endif @@ -632,8 +632,8 @@ ACE_Service_Gestalt::initialize (const ACE_Service_Type *sr, { #ifndef ACE_NLOGGING ACE_DEBUG ((LM_WARNING, - ACE_LIB_TEXT ("ACE (%P|%t) SG::initialize - repo=%@, name=%s") - ACE_LIB_TEXT (" - removing a pre-existing namesake.\n"), + ACE_TEXT ("ACE (%P|%t) SG::initialize - repo=%@, name=%s") + ACE_TEXT (" - removing a pre-existing namesake.\n"), this->repo_, sr->name ())); #endif |