diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-04-14 09:00:32 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-04-14 09:00:32 +0000 |
commit | c0f136a41326ba66daf8883085c8f51d51231def (patch) | |
tree | 8e17c0c010a9935ec2ab282d7b4b0293dbf2799a /ACE/ace | |
parent | 7aac0e0f7495742f1462f162c2fa447359936cc3 (diff) | |
download | ATCD-c0f136a41326ba66daf8883085c8f51d51231def.tar.gz |
Mon Apr 14 08:59:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ACE/ace')
-rw-r--r-- | ACE/ace/Codeset_Registry.h | 2 | ||||
-rw-r--r-- | ACE/ace/Makefile.am | 2 | ||||
-rw-r--r-- | ACE/ace/Service_Config.cpp | 59 | ||||
-rw-r--r-- | ACE/ace/Service_Config.h | 9 | ||||
-rw-r--r-- | ACE/ace/Service_Config.inl | 16 | ||||
-rw-r--r-- | ACE/ace/Shared_Object.h | 5 | ||||
-rw-r--r-- | ACE/ace/Threading_Helper_T.cpp | 83 |
7 files changed, 101 insertions, 75 deletions
diff --git a/ACE/ace/Codeset_Registry.h b/ACE/ace/Codeset_Registry.h index eb8d013d4af..331fcff37da 100644 --- a/ACE/ace/Codeset_Registry.h +++ b/ACE/ace/Codeset_Registry.h @@ -14,7 +14,7 @@ * via translators and the CDR streams, primarily in TAO, but this capability * is not restricted to CORBA. * - * The emulated functionalty supports Open Group RFC #40, currently RFC 40.2, + * The emulated functionality supports Open Group RFC #40, currently RFC 40.2, * www.opengroup.org/tech/rfc/rfc40.2.html * * @author Phil Mesnier <mesnier_p@ociweb.com> diff --git a/ACE/ace/Makefile.am b/ACE/ace/Makefile.am index b70b6873ce5..dadd84d368f 100644 --- a/ACE/ace/Makefile.am +++ b/ACE/ace/Makefile.am @@ -980,6 +980,7 @@ nobase_include_HEADERS += \ Svc_Conf.h \ Svc_Conf_Lexer.h \ Svc_Conf_Tokens.h \ + Svc_Conf_Token_Table.h \ Svc_Handler.cpp \ Svc_Handler.h \ Synch.h \ @@ -1026,6 +1027,7 @@ nobase_include_HEADERS += \ Thread_Mutex.inl \ Thread_Semaphore.h \ Thread_Semaphore.inl \ + Threading_Helper_T.cpp \ Throughput_Stats.h \ Time_Value.h \ Time_Value.inl \ diff --git a/ACE/ace/Service_Config.cpp b/ACE/ace/Service_Config.cpp index dfc6c416b50..ddc14dc6e4d 100644 --- a/ACE/ace/Service_Config.cpp +++ b/ACE/ace/Service_Config.cpp @@ -30,61 +30,6 @@ ACE_RCSID (ace, ACE_BEGIN_VERSIONED_NAMESPACE_DECL -template <> -ACE_Threading_Helper<ACE_Thread_Mutex>::ACE_Threading_Helper () - : key_ (ACE_OS::NULL_key) -{ -# if defined (ACE_HAS_TSS_EMULATION) - ACE_Object_Manager::init_tss (); -# endif - - if (ACE_Thread::keycreate (&key_, 0, 0) == -1) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) Failed to create thread key: %p\n"), - "")); - } -} - -template <> -ACE_Threading_Helper<ACE_Null_Mutex>::ACE_Threading_Helper () - : key_ (ACE_OS::NULL_key) -{ -} - -template <> void -ACE_Threading_Helper<ACE_Thread_Mutex>::set (void* p) -{ - if (ACE_Thread::setspecific (key_, p) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) Service Config failed to set thread key value: %p\n"), - "")); -} - -template <> void -ACE_Threading_Helper<ACE_Null_Mutex>::set (void*) -{ -} - -template <> void* -ACE_Threading_Helper<ACE_Thread_Mutex>::get (void) -{ - void* temp = 0; - if (ACE_Thread::getspecific (key_, &temp) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%P|%t) Service Config failed to get thread key value: %p\n"), - ""), - 0); - return temp; -} - -template <> void* -ACE_Threading_Helper<ACE_Null_Mutex>::get (void) -{ - return ACE_Service_Config::singleton()->instance_.get (); -} - - /** * @c ACE_Service_Config is supposed to be a Singleton. This is the * only Configuration Gestalt available for access from static @@ -560,7 +505,7 @@ ACE_Service_Config::reconfigure (void) int ACE_Service_Config::close (void) { - ACE_Service_Config::singleton ()->instance_->close (); + ACE_Service_Config::singleton ()->instance_->close (); // Delete the service repository. All the objects inside the // service repository should already have been finalized. @@ -615,6 +560,4 @@ ACE_Service_Config::reconfig_occurred (int config_occurred) ACE_Service_Config::reconfig_occurred_ = config_occurred; } -// ************************************************************ - ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/Service_Config.h b/ACE/ace/Service_Config.h index b816a75c159..35177e3bcbb 100644 --- a/ACE/ace/Service_Config.h +++ b/ACE/ace/Service_Config.h @@ -651,6 +651,15 @@ ACE_END_VERSIONED_NAMESPACE_DECL #include "ace/Service_Config.inl" #endif /* __ACE_INLINE__ */ +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ace/Threading_Helper_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Threading_Helper_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + + #include /**/ "ace/post.h" diff --git a/ACE/ace/Service_Config.inl b/ACE/ace/Service_Config.inl index 62798c4cd16..c76d1635eb5 100644 --- a/ACE/ace/Service_Config.inl +++ b/ACE/ace/Service_Config.inl @@ -8,19 +8,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL // This is the primary entry point into the ACE_Service_Config (the // constructor just handles simple initializations). - -template <> ACE_INLINE -ACE_Threading_Helper<ACE_Thread_Mutex>::~ACE_Threading_Helper () -{ - ACE_OS::thr_key_detach (this->key_, 0); - ACE_OS::thr_keyfree (this->key_); -} - -template <> ACE_INLINE -ACE_Threading_Helper<ACE_Null_Mutex>::~ACE_Threading_Helper () -{ -} - ACE_INLINE int ACE_Service_Config::open (const ACE_TCHAR program_name[], const ACE_TCHAR *logger_key, @@ -132,8 +119,7 @@ ACE_Service_Config::initialize (const ACE_Service_Type *sr, const ACE_TCHAR *parameters) { ACE_TRACE ("ACE_Service_Config::initialize"); - return ACE_Service_Config::current ()->initialize (sr, - parameters); + return ACE_Service_Config::current ()->initialize (sr, parameters); } /// Process a file containing a list of service configuration diff --git a/ACE/ace/Shared_Object.h b/ACE/ace/Shared_Object.h index a1d25f0f7bb..345ddb41836 100644 --- a/ACE/ace/Shared_Object.h +++ b/ACE/ace/Shared_Object.h @@ -34,8 +34,12 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Export ACE_Shared_Object { public: + /// Constructor ACE_Shared_Object (void); + /// Destructor + virtual ~ACE_Shared_Object (void); + /// Initializes object when dynamic linking occurs. virtual int init (int argc, ACE_TCHAR *argv[]); @@ -45,7 +49,6 @@ public: /// Returns information on a service object. virtual int info (ACE_TCHAR **info_string, size_t length = 0) const; - virtual ~ACE_Shared_Object (void); }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/Threading_Helper_T.cpp b/ACE/ace/Threading_Helper_T.cpp new file mode 100644 index 00000000000..11d5bcc77d9 --- /dev/null +++ b/ACE/ace/Threading_Helper_T.cpp @@ -0,0 +1,83 @@ +#ifndef ACE_THREADING_HELPER_T_CPP +#define ACE_THREADING_HELPER_T_CPP + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +ACE_RCSID(ace, + Threading_Helper_T, + "$Id$") + +template <> +ACE_Threading_Helper<ACE_Thread_Mutex>::~ACE_Threading_Helper () +{ + ACE_OS::thr_key_detach (this->key_, 0); + ACE_OS::thr_keyfree (this->key_); +} + +template <> +ACE_Threading_Helper<ACE_Thread_Mutex>::ACE_Threading_Helper () + : key_ (ACE_OS::NULL_key) +{ +# if defined (ACE_HAS_TSS_EMULATION) + ACE_Object_Manager::init_tss (); +# endif + + if (ACE_Thread::keycreate (&key_, 0, 0) == -1) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) Failed to create thread key: %p\n"), + "")); + } +} + +template <> void +ACE_Threading_Helper<ACE_Thread_Mutex>::set (void* p) +{ + if (ACE_Thread::setspecific (key_, p) == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) Service Config failed to set thread key value: %p\n"), + "")); +} + +template <> void* +ACE_Threading_Helper<ACE_Thread_Mutex>::get (void) +{ + void* temp = 0; + if (ACE_Thread::getspecific (key_, &temp) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("(%P|%t) Service Config failed to get thread key value: %p\n"), + ""), + 0); + return temp; +} + +template <> +ACE_Threading_Helper<ACE_Null_Mutex>::~ACE_Threading_Helper () +{ +} + +template <> +ACE_Threading_Helper<ACE_Null_Mutex>::ACE_Threading_Helper () + : key_ (ACE_OS::NULL_key) +{ +} + +template <> void +ACE_Threading_Helper<ACE_Null_Mutex>::set (void*) +{ +} + +template <> void* +ACE_Threading_Helper<ACE_Null_Mutex>::get (void) +{ + return ACE_Service_Config::singleton()->instance_.get (); +} + +ACE_END_VERSIONED_NAMESPACE_DECL + +#endif /* ACE_THREADING_HELPER_T_CPP */ + |