]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#885,!570] removed thread_local
authorRazvan Becheriu <razvan@isc.org>
Mon, 28 Oct 2019 09:19:09 +0000 (11:19 +0200)
committerRazvan Becheriu <razvan@isc.org>
Wed, 6 Nov 2019 15:58:59 +0000 (17:58 +0200)
src/lib/dhcpsrv/pgsql_host_data_source.cc
src/lib/dhcpsrv/pgsql_lease_mgr.cc

index aa6d773024edf59f5402cf791dfad508170536a7..b4d22499ec91d79a935f114c65b02d3c789f2dd3 100644 (file)
@@ -1986,7 +1986,7 @@ PgSqlHostDataSourceImpl::delStatement(StatementIndex stindex,
 void
 PgSqlHostDataSourceImpl::addResv(const IPv6Resrv& resv,
                                  const HostID& id) {
-    thread_local std::shared_ptr<PgSqlIPv6ReservationExchange> host_ipv6_reservation_exchange(
+    std::shared_ptr<PgSqlIPv6ReservationExchange> host_ipv6_reservation_exchange(
         std::make_shared<PgSqlIPv6ReservationExchange>());
 
     PsqlBindArrayPtr bind_array;
@@ -2001,7 +2001,7 @@ PgSqlHostDataSourceImpl::addOption(const StatementIndex& stindex,
                                    const std::string& opt_space,
                                    const Optional<SubnetID>&,
                                    const HostID& id) {
-    thread_local std::shared_ptr<PgSqlOptionExchange> host_option_exchange(
+    std::shared_ptr<PgSqlOptionExchange> host_option_exchange(
         std::make_shared<PgSqlOptionExchange>());
 
     PsqlBindArrayPtr bind_array;
@@ -2140,7 +2140,7 @@ PgSqlHostDataSource::add(const HostPtr& host) {
     // If operating in read-only mode, throw exception.
     impl_->checkReadOnly();
 
-    thread_local std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
+    std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
         std::make_shared<PgSqlHostWithOptionsExchange>(PgSqlHostWithOptionsExchange::DHCP4_ONLY));
 
     // Initiate PostgreSQL transaction as we will have to make multiple queries
@@ -2250,7 +2250,7 @@ ConstHostCollection
 PgSqlHostDataSource::getAll(const Host::IdentifierType& identifier_type,
                             const uint8_t* identifier_begin,
                             const size_t identifier_len) const {
-    thread_local std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv46_exchange(
+    std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv46_exchange(
         std::make_shared<PgSqlHostIPv6Exchange>(PgSqlHostWithOptionsExchange::DHCP4_AND_DHCP6));
 
     // Set up the WHERE clause value
@@ -2270,7 +2270,7 @@ PgSqlHostDataSource::getAll(const Host::IdentifierType& identifier_type,
 
 ConstHostCollection
 PgSqlHostDataSource::getAll4(const SubnetID& subnet_id) const {
-    thread_local std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
+    std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
         std::make_shared<PgSqlHostWithOptionsExchange>(PgSqlHostWithOptionsExchange::DHCP4_ONLY));
 
     // Set up the WHERE clause value
@@ -2288,7 +2288,7 @@ PgSqlHostDataSource::getAll4(const SubnetID& subnet_id) const {
 
 ConstHostCollection
 PgSqlHostDataSource::getAll6(const SubnetID& subnet_id) const {
-    thread_local std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
+    std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
         std::make_shared<PgSqlHostIPv6Exchange>(PgSqlHostWithOptionsExchange::DHCP6_ONLY));
 
     // Set up the WHERE clause value
@@ -2306,7 +2306,7 @@ PgSqlHostDataSource::getAll6(const SubnetID& subnet_id) const {
 
 ConstHostCollection
 PgSqlHostDataSource::getAllbyHostname(const std::string& hostname) const {
-    thread_local std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv46_exchange(
+    std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv46_exchange(
         std::make_shared<PgSqlHostIPv6Exchange>(PgSqlHostWithOptionsExchange::DHCP4_AND_DHCP6));
 
     // Set up the WHERE clause value
@@ -2325,7 +2325,7 @@ PgSqlHostDataSource::getAllbyHostname(const std::string& hostname) const {
 ConstHostCollection
 PgSqlHostDataSource::getAllbyHostname4(const std::string& hostname,
                                        const SubnetID& subnet_id) const {
-    thread_local std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
+    std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
         std::make_shared<PgSqlHostWithOptionsExchange>(PgSqlHostWithOptionsExchange::DHCP4_ONLY));
 
     // Set up the WHERE clause value
@@ -2347,7 +2347,7 @@ PgSqlHostDataSource::getAllbyHostname4(const std::string& hostname,
 ConstHostCollection
 PgSqlHostDataSource::getAllbyHostname6(const std::string& hostname,
                                        const SubnetID& subnet_id) const {
-    thread_local std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
+    std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
         std::make_shared<PgSqlHostIPv6Exchange>(PgSqlHostWithOptionsExchange::DHCP6_ONLY));
 
     // Set up the WHERE clause value
@@ -2371,7 +2371,7 @@ PgSqlHostDataSource::getPage4(const SubnetID& subnet_id,
                               size_t& /*source_index*/,
                               uint64_t lower_host_id,
                               const HostPageSize& page_size) const {
-    thread_local std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
+    std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
         std::make_shared<PgSqlHostWithOptionsExchange>(PgSqlHostWithOptionsExchange::DHCP4_ONLY));
 
     // Set up the WHERE clause value
@@ -2400,7 +2400,7 @@ PgSqlHostDataSource::getPage6(const SubnetID& subnet_id,
                               size_t& /*source_index*/,
                               uint64_t lower_host_id,
                               const HostPageSize& page_size) const {
-    thread_local std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
+    std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
         std::make_shared<PgSqlHostIPv6Exchange>(PgSqlHostWithOptionsExchange::DHCP6_ONLY));
 
     // Set up the WHERE clause value
@@ -2426,7 +2426,7 @@ PgSqlHostDataSource::getPage6(const SubnetID& subnet_id,
 
 ConstHostCollection
 PgSqlHostDataSource::getAll4(const asiolink::IOAddress& address) const {
-    thread_local std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
+    std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
         std::make_shared<PgSqlHostWithOptionsExchange>(PgSqlHostWithOptionsExchange::DHCP4_ONLY));
 
     // Set up the WHERE clause value
@@ -2447,7 +2447,7 @@ PgSqlHostDataSource::get4(const SubnetID& subnet_id,
                           const Host::IdentifierType& identifier_type,
                           const uint8_t* identifier_begin,
                           const size_t identifier_len) const {
-    thread_local std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
+    std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
         std::make_shared<PgSqlHostWithOptionsExchange>(PgSqlHostWithOptionsExchange::DHCP4_ONLY));
 
     return (impl_->getHost(subnet_id, identifier_type, identifier_begin,
@@ -2464,7 +2464,7 @@ PgSqlHostDataSource::get4(const SubnetID& subnet_id,
                   "wrong address type, address supplied is an IPv6 address");
     }
 
-    thread_local std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
+    std::shared_ptr<PgSqlHostWithOptionsExchange> host_ipv4_exchange(
         std::make_shared<PgSqlHostWithOptionsExchange>(PgSqlHostWithOptionsExchange::DHCP4_ONLY));
 
     // Set up the WHERE clause value
@@ -2494,7 +2494,7 @@ PgSqlHostDataSource::get6(const SubnetID& subnet_id,
                           const Host::IdentifierType& identifier_type,
                           const uint8_t* identifier_begin,
                           const size_t identifier_len) const {
-    thread_local std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
+    std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
         std::make_shared<PgSqlHostIPv6Exchange>(PgSqlHostWithOptionsExchange::DHCP6_ONLY));
 
     return (impl_->getHost(subnet_id, identifier_type, identifier_begin,
@@ -2510,7 +2510,7 @@ PgSqlHostDataSource::get6(const asiolink::IOAddress& prefix,
                   "wrong address type, address supplied is an IPv4 address");
     }
 
-    thread_local std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
+    std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
         std::make_shared<PgSqlHostIPv6Exchange>(PgSqlHostWithOptionsExchange::DHCP6_ONLY));
 
     // Set up the WHERE clause value
@@ -2543,7 +2543,7 @@ PgSqlHostDataSource::get6(const SubnetID& subnet_id,
                   "wrong address type, address supplied is an IPv4 address");
     }
 
-    thread_local std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
+    std::shared_ptr<PgSqlHostIPv6Exchange> host_ipv6_exchange(
         std::make_shared<PgSqlHostIPv6Exchange>(PgSqlHostWithOptionsExchange::DHCP6_ONLY));
 
     // Set up the WHERE clause value
index 83ce3c21d5156dd5b23b229f6bb93488fcf9c392..a4691ffad32a7197d9b9055ca3a1b5ef658085d1 100644 (file)
@@ -1182,7 +1182,7 @@ PgSqlLeaseMgr::addLeaseCommon(StatementIndex stindex,
 
 bool
 PgSqlLeaseMgr::addLease(const Lease4Ptr& lease) {
-    thread_local std::shared_ptr<PgSqlLease4Exchange> exchange4(
+    std::shared_ptr<PgSqlLease4Exchange> exchange4(
         std::make_shared<PgSqlLease4Exchange>());
 
     LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
@@ -1195,7 +1195,7 @@ PgSqlLeaseMgr::addLease(const Lease4Ptr& lease) {
 
 bool
 PgSqlLeaseMgr::addLease(const Lease6Ptr& lease) {
-    thread_local std::shared_ptr<PgSqlLease6Exchange> exchange6(
+    std::shared_ptr<PgSqlLease6Exchange> exchange6(
         std::make_shared<PgSqlLease6Exchange>());
 
     LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
@@ -1235,7 +1235,7 @@ void PgSqlLeaseMgr::getLeaseCollection(StatementIndex stindex,
 void
 PgSqlLeaseMgr::getLeaseCollection(StatementIndex stindex, db::PsqlBindArray& bind_array,
                                   Lease4Collection& result) const {
-    thread_local std::shared_ptr<PgSqlLease4Exchange> exchange4(
+    std::shared_ptr<PgSqlLease4Exchange> exchange4(
         std::make_shared<PgSqlLease4Exchange>());
 
     getLeaseCollection(stindex, bind_array, exchange4, result);
@@ -1244,7 +1244,7 @@ PgSqlLeaseMgr::getLeaseCollection(StatementIndex stindex, db::PsqlBindArray& bin
 void
 PgSqlLeaseMgr::getLeaseCollection(StatementIndex stindex, db::PsqlBindArray& bind_array,
                                   Lease6Collection& result) const {
-    thread_local std::shared_ptr<PgSqlLease6Exchange> exchange6(
+    std::shared_ptr<PgSqlLease6Exchange> exchange6(
         std::make_shared<PgSqlLease6Exchange>());
 
     getLeaseCollection(stindex, bind_array, exchange6, result);
@@ -1253,7 +1253,7 @@ PgSqlLeaseMgr::getLeaseCollection(StatementIndex stindex, db::PsqlBindArray& bin
 void
 PgSqlLeaseMgr::getLease(StatementIndex stindex, PsqlBindArray& bind_array,
                         Lease4Ptr& result) const {
-    thread_local std::shared_ptr<PgSqlLease4Exchange> exchange4(
+    std::shared_ptr<PgSqlLease4Exchange> exchange4(
         std::make_shared<PgSqlLease4Exchange>());
 
     // Create appropriate collection object and get all leases matching
@@ -1275,7 +1275,7 @@ PgSqlLeaseMgr::getLease(StatementIndex stindex, PsqlBindArray& bind_array,
 void
 PgSqlLeaseMgr::getLease(StatementIndex stindex, PsqlBindArray& bind_array,
                         Lease6Ptr& result) const {
-    thread_local std::shared_ptr<PgSqlLease6Exchange> exchange6(
+    std::shared_ptr<PgSqlLease6Exchange> exchange6(
         std::make_shared<PgSqlLease6Exchange>());
 
     // Create appropriate collection object and get all leases matching
@@ -1767,7 +1767,7 @@ PgSqlLeaseMgr::updateLeaseCommon(StatementIndex stindex,
 
 void
 PgSqlLeaseMgr::updateLease4(const Lease4Ptr& lease) {
-    thread_local std::shared_ptr<PgSqlLease4Exchange> exchange4(
+    std::shared_ptr<PgSqlLease4Exchange> exchange4(
         std::make_shared<PgSqlLease4Exchange>());
 
     const StatementIndex stindex = UPDATE_LEASE4;
@@ -1789,7 +1789,7 @@ PgSqlLeaseMgr::updateLease4(const Lease4Ptr& lease) {
 
 void
 PgSqlLeaseMgr::updateLease6(const Lease6Ptr& lease) {
-    thread_local std::shared_ptr<PgSqlLease6Exchange> exchange6(
+    std::shared_ptr<PgSqlLease6Exchange> exchange6(
         std::make_shared<PgSqlLease6Exchange>());
 
     const StatementIndex stindex = UPDATE_LEASE6;