From 4752a5c58bc37a9d0cb51c6efa652290fa9505ca Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Thu, 1 Nov 2007 11:12:31 +0000 Subject: Thu Nov 1 11:11:15 UTC 2007 Johnny Willemsen --- ACE/ace/Service_Config.cpp | 2 +- ACE/ace/Service_Config.h | 46 ++++++--------------------------------------- ACE/ace/Service_Config.inl | 5 ++--- ACE/ace/Service_Gestalt.cpp | 4 ++-- ACE/ace/Service_Gestalt.h | 4 ++-- 5 files changed, 13 insertions(+), 48 deletions(-) (limited to 'ACE/ace') diff --git a/ACE/ace/Service_Config.cpp b/ACE/ace/Service_Config.cpp index a73b0a67b09..9bd72bcf348 100644 --- a/ACE/ace/Service_Config.cpp +++ b/ACE/ace/Service_Config.cpp @@ -374,7 +374,7 @@ ACE_Service_Config::resume (const ACE_TCHAR svc_name[]) } -ACE_Service_Config::ACE_Service_Config (int ignore_static_svcs, +ACE_Service_Config::ACE_Service_Config (bool ignore_static_svcs, size_t size, int signum) : ACE_Service_Gestalt (size, false, ignore_static_svcs) diff --git a/ACE/ace/Service_Config.h b/ACE/ace/Service_Config.h index 551333761be..1c1c147af8f 100644 --- a/ACE/ace/Service_Config.h +++ b/ACE/ace/Service_Config.h @@ -135,40 +135,6 @@ public: #define ACE_Component_Config ACE_Service_Config -/// This specialization enures ACE_TSS will _not_ perform a delete on -/// (ACE_Service_Gestalt*) p upon thread exit, when TSS is cleaned -/// up. Note that the tss_ member will be destroyed with the -/// ACE_Object_Manager's ACE_Service_Config singleton, so no leaks -/// will be introduced. -/// We need this non-ownership ACE_TSS because the SC instance is -/// really owned by the Object Manager and only it must do the cleanup. -/// -/// Naturally, things would be simpler, if we could -/// avoid using the TSS altogether but we need the ability to -/// temporarily designate a different SC instance as the "default." -/// So, the solution is a hybrid, or non-owner ACE_TSS. See bugzila -/// 2980 for a description of a test case where ACE_TSS::cleanup() is -/// called before ~ACE_Object_Manager. - -# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -// Since ACE_TSS<>::cleanup() is only defined in -// multithreaded builds ... -template<> inline void -ACE_TSS::cleanup (void*ptr) -{ - // Borland C++ 2007 *needs* the parameter - // name, but it is not clear why ... - ACE_UNUSED_ARG (ptr); -} -# else -template<> inline -ACE_TSS::~ACE_TSS (void) -{ - // Without threads, the ACE_TSS cleanup is done by ~ACE_TSS() -} -# endif /* ACE_MT_SAFE */ - - /** * @class ACE_Service_Config * @@ -212,7 +178,7 @@ public: * signum to a negative number will prevent a signal handler being * registered when the repository is opened. */ - ACE_Service_Config (int ignore_static_svcs = 1, + ACE_Service_Config (bool ignore_static_svcs = true, size_t size = ACE_Service_Gestalt::MAX_SERVICES, int signum = SIGHUP); @@ -305,7 +271,7 @@ public: * Performs an open without parsing command-line arguments. The * @a logger_key indicates where to write the logging output, which * is typically either a STREAM pipe or a socket address. If - * @a ignore_static_svcs is 1 then static services are not loaded, + * @a ignore_static_svcs is true then static services are not loaded, * otherwise, they are loaded. If @a ignore_default_svc_conf_file is * non-0 then the configuration file will be ignored. * Returns zero upon success, -1 if the file is not found or cannot @@ -357,11 +323,11 @@ public: * @param logger_key Indicates where to write the logging output, * which is typically either a STREAM pipe or a * socket address. - * @param ignore_static_svcs If 1 then static services are not loaded, + * @param ignore_static_svcs If true then static services are not loaded, * otherwise, they are loaded. * @param ignore_default_svc_conf_file If non-0 then the @c svc.conf * configuration file will be ignored. - * @param ignore_debug_flag If non-0 then the application is responsible + * @param ignore_debug_flag If true then the application is responsible * for setting the @c ACE_Log_Msg::priority_mask * appropriately. * @@ -379,7 +345,7 @@ public: bool ignore_debug_flag = false); /// Tidy up and perform last rites when ACE_Service_Config is shut - /// down. This method calls . Returns 0. + /// down. This method calls close_svcs(). Returns 0. static int close (void); /// Perform user-specified close hooks and possibly delete all of the @@ -500,7 +466,7 @@ public: * @return Returns -1 if the service cannot be 'loaded'. */ static int process_directive (const ACE_Static_Svc_Descriptor &ssd, - int force_replace = 0); + bool force_replace = false); /** * Process (or re-process) service configuration requests that are diff --git a/ACE/ace/Service_Config.inl b/ACE/ace/Service_Config.inl index 341692c79ea..582d4a3cb68 100644 --- a/ACE/ace/Service_Config.inl +++ b/ACE/ace/Service_Config.inl @@ -152,10 +152,9 @@ ACE_Service_Config::process_directives (void) ACE_INLINE int ACE_Service_Config::process_directive (const ACE_Static_Svc_Descriptor &ssd, - int force_replace) + bool force_replace) { - return ACE_Service_Config::current ()->process_directive (ssd, - force_replace); + return ACE_Service_Config::current ()->process_directive (ssd, force_replace); } diff --git a/ACE/ace/Service_Gestalt.cpp b/ACE/ace/Service_Gestalt.cpp index 2d603990506..c644ec6ef72 100644 --- a/ACE/ace/Service_Gestalt.cpp +++ b/ACE/ace/Service_Gestalt.cpp @@ -723,7 +723,7 @@ ACE_Service_Gestalt::resume (const ACE_TCHAR svc_name[]) int ACE_Service_Gestalt::process_directive (const ACE_Static_Svc_Descriptor &ssd, - int force_replace) + bool force_replace) { int const result = process_directive_i (ssd, force_replace); if (result == 0) @@ -735,7 +735,7 @@ ACE_Service_Gestalt::process_directive (const ACE_Static_Svc_Descriptor &ssd, int ACE_Service_Gestalt::process_directive_i (const ACE_Static_Svc_Descriptor &ssd, - int force_replace) + bool force_replace) { if (this->repo_ == 0) return -1; diff --git a/ACE/ace/Service_Gestalt.h b/ACE/ace/Service_Gestalt.h index fc0905f85e3..eee906f40c3 100644 --- a/ACE/ace/Service_Gestalt.h +++ b/ACE/ace/Service_Gestalt.h @@ -195,7 +195,7 @@ public: * @return Returns -1 if the service cannot be 'loaded'. */ int process_directive (const ACE_Static_Svc_Descriptor &ssd, - int force_replace = 0); + bool force_replace = false); /// Process a file containing a list of service configuration /// directives. @@ -353,7 +353,7 @@ protected: /// the global table. This avoids multiple additions when processing /// directives in non-global gestalts. int process_directive_i (const ACE_Static_Svc_Descriptor &ssd, - int force_replace = 0); + bool force_replace = false); #if (ACE_USES_CLASSIC_SVC_CONF == 1) /// This is the implementation function that process_directives() -- cgit v1.2.1