summaryrefslogtreecommitdiff
path: root/ACE/ace/Service_Config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/ace/Service_Config.cpp')
-rw-r--r--ACE/ace/Service_Config.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/ACE/ace/Service_Config.cpp b/ACE/ace/Service_Config.cpp
index ddc14dc6e4d..c4bd580b70a 100644
--- a/ACE/ace/Service_Config.cpp
+++ b/ACE/ace/Service_Config.cpp
@@ -30,6 +30,67 @@ ACE_RCSID (ace,
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+ACE_Threading_Helper<ACE_Thread_Mutex>::~ACE_Threading_Helper ()
+{
+ ACE_OS::thr_key_detach (this->key_, 0);
+ ACE_OS::thr_keyfree (this->key_);
+}
+
+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"),
+ ""));
+ }
+}
+
+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"),
+ ""));
+}
+
+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;
+}
+
+ACE_Threading_Helper<ACE_Null_Mutex>::~ACE_Threading_Helper ()
+{
+}
+
+ACE_Threading_Helper<ACE_Null_Mutex>::ACE_Threading_Helper ()
+{
+}
+
+void
+ACE_Threading_Helper<ACE_Null_Mutex>::set (void*)
+{
+}
+
+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