summaryrefslogtreecommitdiff
path: root/TAO/tao/Dynamic_TP
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2020-12-09 16:45:48 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2020-12-09 16:45:48 +0100
commit419b95663619dcdc3efba31719c382482206875f (patch)
tree418aac872162edda12dd42a5ed47d1abfa48008d /TAO/tao/Dynamic_TP
parent61cd647874bd1717fe2854421dce3d42fdb04c57 (diff)
downloadATCD-419b95663619dcdc3efba31719c382482206875f.tar.gz
Removed checks for ACE_HAS_CPP11 and use std::atomic in more places in the TAO core
Diffstat (limited to 'TAO/tao/Dynamic_TP')
-rw-r--r--TAO/tao/Dynamic_TP/DTP_Task.cpp4
-rw-r--r--TAO/tao/Dynamic_TP/DTP_Task.h3
-rw-r--r--TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp4
3 files changed, 4 insertions, 7 deletions
diff --git a/TAO/tao/Dynamic_TP/DTP_Task.cpp b/TAO/tao/Dynamic_TP/DTP_Task.cpp
index 5dac916eede..80a3bbd2dd2 100644
--- a/TAO/tao/Dynamic_TP/DTP_Task.cpp
+++ b/TAO/tao/Dynamic_TP/DTP_Task.cpp
@@ -345,7 +345,7 @@ TAO_DTP_Task::svc (void)
ACE_TEXT ("TAO (%P|%t) - DTP_Task::svc() ")
ACE_TEXT ("Decrementing busy_threads_. ")
ACE_TEXT ("Busy thread count:%d\n"),
- this->busy_threads_.value()));
+ this->busy_threads_.load()));
}
ACE_Time_Value tmp_sec = this->thread_idle_time_.to_absolute_time();
@@ -385,7 +385,7 @@ TAO_DTP_Task::svc (void)
ACE_TEXT ("TAO (%P|%t) - DTP_Task::svc() ")
ACE_TEXT ("Incrementing busy_threads_. ")
ACE_TEXT ("Busy thread count:%d\n"),
- this->busy_threads_.value ()));
+ this->busy_threads_.load ()));
}
}
}
diff --git a/TAO/tao/Dynamic_TP/DTP_Task.h b/TAO/tao/Dynamic_TP/DTP_Task.h
index 73dfeff8651..c39e3b57772 100644
--- a/TAO/tao/Dynamic_TP/DTP_Task.h
+++ b/TAO/tao/Dynamic_TP/DTP_Task.h
@@ -31,6 +31,7 @@
#include "ace/Synch.h"
#include "ace/Containers_T.h"
#include "ace/Vector_T.h"
+#include <atomic>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -177,7 +178,7 @@ private:
size_t num_queue_requests_;
/// The number of currently active worker threads.
- ACE_Atomic_Op <TAO_SYNCH_MUTEX, unsigned long> busy_threads_;
+ std::atomic<unsigned long> busy_threads_;
/// The queue of pending servant requests (a.k.a. the "request queue").
TAO::CSD::TP_Queue queue_;
diff --git a/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp b/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp
index a51873958c1..bfc7bcc1a0d 100644
--- a/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp
+++ b/TAO/tao/Dynamic_TP/DTP_Thread_Pool.cpp
@@ -519,11 +519,7 @@ CORBA::ULong
TAO_DTP_Thread_Pool_Manager::create_threadpool_helper (TAO_DTP_Thread_Pool *thread_pool)
{
// Make sure of safe deletion in case of errors.
-#if defined (ACE_HAS_CPP11)
std::unique_ptr<TAO_DTP_Thread_Pool> safe_thread_pool (thread_pool);
-#else
- auto_ptr<TAO_DTP_Thread_Pool> safe_thread_pool (thread_pool);
-#endif /* ACE_HAS_CPP11 */
// Open the pool.
thread_pool->open ();