summaryrefslogtreecommitdiff
path: root/TAO/tao/DynamicInterface
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/DynamicInterface')
-rw-r--r--TAO/tao/DynamicInterface/Context.cpp12
-rw-r--r--TAO/tao/DynamicInterface/Context.h19
-rw-r--r--TAO/tao/DynamicInterface/ExceptionList.cpp6
-rw-r--r--TAO/tao/DynamicInterface/ExceptionList.h13
-rw-r--r--TAO/tao/DynamicInterface/ExceptionList.inl2
-rw-r--r--TAO/tao/DynamicInterface/Request.h10
-rw-r--r--TAO/tao/DynamicInterface/Server_Request.h10
7 files changed, 53 insertions, 19 deletions
diff --git a/TAO/tao/DynamicInterface/Context.cpp b/TAO/tao/DynamicInterface/Context.cpp
index 01cb4234dbb..92f4a4a6161 100644
--- a/TAO/tao/DynamicInterface/Context.cpp
+++ b/TAO/tao/DynamicInterface/Context.cpp
@@ -84,7 +84,7 @@ CORBA::Context::get_values (const char * /* start_scope */,
}
CORBA::ContextList::ContextList (CORBA::ULong len, char* *ctx_list)
- : ref_count_ (1)
+ : refcount_ (1)
{
for (CORBA::ULong i=0; i < len; i++)
{
@@ -143,14 +143,14 @@ CORBA::ContextList::remove (CORBA::ULong)
CORBA::ContextList_ptr
CORBA::ContextList::_duplicate (void)
{
- ++this->ref_count_;
+ ++this->refcount_;
return this;
}
void
CORBA::ContextList::_destroy (void)
{
- CORBA::ULong const current = --this->ref_count_;
+ CORBA::ULong const current = --this->refcount_;
if (current == 0)
{
@@ -161,15 +161,15 @@ CORBA::ContextList::_destroy (void)
void
CORBA::ContextList::_incr_refcount (void)
{
- ++this->ref_count_;
+ ++this->refcount_;
}
void
CORBA::ContextList::_decr_refcount (void)
{
- --this->ref_count_;
+ --this->refcount_;
- if (this->ref_count_ != 0)
+ if (this->refcount_ != 0)
{
delete this;
}
diff --git a/TAO/tao/DynamicInterface/Context.h b/TAO/tao/DynamicInterface/Context.h
index a20b50554c4..30c269457a0 100644
--- a/TAO/tao/DynamicInterface/Context.h
+++ b/TAO/tao/DynamicInterface/Context.h
@@ -31,8 +31,11 @@
#include "tao/default_environment.h"
#include "ace/Unbounded_Queue.h"
-#include "ace/Atomic_Op.h"
-#include "ace/Synch_Traits.h"
+#if defined (ACE_HAS_CPP11)
+# include <atomic>
+#else
+# include "ace/Atomic_Op.h"
+#endif /* ACE_HAS_CPP11 */
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -111,7 +114,11 @@ namespace CORBA
private:
/// Reference counter.
- ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong> refcount_;
+#if defined (ACE_HAS_CPP11)
+ std::atomic<uint32_t> refcount_;
+#else
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> refcount_;
+#endif /* ACE_HAS_CPP11 */
};
/**
@@ -176,7 +183,11 @@ namespace CORBA
ContextList &operator= (const ContextList &);
/// Reference counter.
- ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong> ref_count_;
+#if defined (ACE_HAS_CPP11)
+ std::atomic<uint32_t> refcount_;
+#else
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> refcount_;
+#endif /* ACE_HAS_CPP11 */
/// Internal list of typecodes.
ACE_Unbounded_Queue<char *> ctx_list_;
diff --git a/TAO/tao/DynamicInterface/ExceptionList.cpp b/TAO/tao/DynamicInterface/ExceptionList.cpp
index 5fb4d67b4a0..40a06e0ded3 100644
--- a/TAO/tao/DynamicInterface/ExceptionList.cpp
+++ b/TAO/tao/DynamicInterface/ExceptionList.cpp
@@ -10,7 +10,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
CORBA::ExceptionList::ExceptionList (CORBA::ULong len,
CORBA::TypeCode_ptr *tc_list)
- : ref_count_ (1)
+ : refcount_ (1)
{
for (CORBA::ULong i = 0; i < len; ++i)
{
@@ -82,13 +82,13 @@ CORBA::ExceptionList::_destroy (void)
void
CORBA::ExceptionList::_incr_refcount (void)
{
- ++this->ref_count_;
+ ++this->refcount_;
}
void
CORBA::ExceptionList::_decr_refcount (void)
{
- CORBA::ULong const refcount = --this->ref_count_;
+ CORBA::ULong const refcount = --this->refcount_;
if (refcount == 0)
{
diff --git a/TAO/tao/DynamicInterface/ExceptionList.h b/TAO/tao/DynamicInterface/ExceptionList.h
index ab040f80b7d..cf4008f0f6c 100644
--- a/TAO/tao/DynamicInterface/ExceptionList.h
+++ b/TAO/tao/DynamicInterface/ExceptionList.h
@@ -30,8 +30,11 @@
#include "tao/Pseudo_VarOut_T.h"
#include "ace/Unbounded_Queue.h"
-#include "ace/Atomic_Op.h"
-#include "ace/Synch_Traits.h"
+#if defined (ACE_HAS_CPP11)
+# include <atomic>
+#else
+# include "ace/Atomic_Op.h"
+#endif /* ACE_HAS_CPP11 */
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -105,7 +108,11 @@ namespace CORBA
ExceptionList &operator= (const ExceptionList &);
/// Reference counter.
- ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong> ref_count_;
+#if defined (ACE_HAS_CPP11)
+ std::atomic<uint32_t> refcount_;
+#else
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong> refcount_;
+#endif /* ACE_HAS_CPP11 */
/// Internal list of typecodes.
ACE_Unbounded_Queue<CORBA::TypeCode_ptr> tc_list_;
diff --git a/TAO/tao/DynamicInterface/ExceptionList.inl b/TAO/tao/DynamicInterface/ExceptionList.inl
index 21c37cc3898..4178f77d903 100644
--- a/TAO/tao/DynamicInterface/ExceptionList.inl
+++ b/TAO/tao/DynamicInterface/ExceptionList.inl
@@ -3,7 +3,7 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE
CORBA::ExceptionList::ExceptionList (void)
- : ref_count_ (1)
+ : refcount_ (1)
{
}
diff --git a/TAO/tao/DynamicInterface/Request.h b/TAO/tao/DynamicInterface/Request.h
index 997309f279a..0560d577255 100644
--- a/TAO/tao/DynamicInterface/Request.h
+++ b/TAO/tao/DynamicInterface/Request.h
@@ -40,7 +40,11 @@
#endif /* TAO_HAS_AMI */
#include "ace/SString.h"
-#include "ace/Atomic_Op.h"
+#if defined (ACE_HAS_CPP11)
+# include <atomic>
+#else
+# include "ace/Atomic_Op.h"
+#endif /* ACE_HAS_CPP11 */
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -246,7 +250,11 @@ namespace CORBA
CORBA::Context_ptr ctx_;
/// Reference counting.
+#if defined (ACE_HAS_CPP11)
+ std::atomic<uint32_t> refcount_;
+#else
ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> refcount_;
+#endif /* ACE_HAS_CPP11 */
/// Protect the response_received_.
TAO_SYNCH_MUTEX lock_;
diff --git a/TAO/tao/DynamicInterface/Server_Request.h b/TAO/tao/DynamicInterface/Server_Request.h
index 532e8498e3a..555e1c4f8f7 100644
--- a/TAO/tao/DynamicInterface/Server_Request.h
+++ b/TAO/tao/DynamicInterface/Server_Request.h
@@ -29,7 +29,11 @@
#include "tao/TAO_Server_Request.h"
#include "tao/CDR.h"
-#include "ace/Atomic_Op.h"
+#if defined (ACE_HAS_CPP11)
+# include <atomic>
+#else
+# include "ace/Atomic_Op.h"
+#endif /* ACE_HAS_CPP11 */
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -146,7 +150,11 @@ namespace CORBA
CORBA::Any_ptr exception_;
/// Reference counting.
+#if defined (ACE_HAS_CPP11)
+ std::atomic<uint32_t> refcount_;
+#else
ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> refcount_;
+#endif /* ACE_HAS_CPP11 */
/// Request from the ORB.
TAO_ServerRequest &orb_server_request_;